mirror of https://github.com/vernonkeenan/lib
parent
b3029bf4f5
commit
7f54aa7811
|
@ -0,0 +1,240 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetPromptAnswersParams creates a new GetPromptAnswersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetPromptAnswersParams() *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithTimeout creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetPromptAnswersParamsWithTimeout(timeout time.Duration) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithContext creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetPromptAnswersParamsWithContext(ctx context.Context) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithHTTPClient creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetPromptAnswersParamsWithHTTPClient(client *http.Client) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get prompt answers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetPromptAnswersParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPromptAnswersParams) WithDefaults() *GetPromptAnswersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPromptAnswersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithTimeout(timeout time.Duration) *GetPromptAnswersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithContext(ctx context.Context) *GetPromptAnswersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithHTTPClient(client *http.Client) *GetPromptAnswersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithID(id *string) *GetPromptAnswersParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithLimit(limit *int64) *GetPromptAnswersParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithOffset(offset *int64) *GetPromptAnswersParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetPromptAnswersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,486 @@
|
|||
// 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
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// GetPromptAnswersReader is a Reader for the GetPromptAnswers structure.
|
||||
type GetPromptAnswersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetPromptAnswersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetPromptAnswersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetPromptAnswersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetPromptAnswersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetPromptAnswersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetPromptAnswersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetPromptAnswersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersOK creates a GetPromptAnswersOK with default headers values
|
||||
func NewGetPromptAnswersOK() *GetPromptAnswersOK {
|
||||
return &GetPromptAnswersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type GetPromptAnswersOK struct {
|
||||
Payload *members_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers o k response has a 2xx status code
|
||||
func (o *GetPromptAnswersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers o k response has a 3xx status code
|
||||
func (o *GetPromptAnswersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers o k response has a 4xx status code
|
||||
func (o *GetPromptAnswersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers o k response has a 5xx status code
|
||||
func (o *GetPromptAnswersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers o k response a status code equal to that given
|
||||
func (o *GetPromptAnswersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers o k response
|
||||
func (o *GetPromptAnswersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) GetPayload() *members_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersUnauthorized creates a GetPromptAnswersUnauthorized with default headers values
|
||||
func NewGetPromptAnswersUnauthorized() *GetPromptAnswersUnauthorized {
|
||||
return &GetPromptAnswersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetPromptAnswersUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers unauthorized response has a 2xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers unauthorized response has a 3xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers unauthorized response has a 4xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers unauthorized response has a 5xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers unauthorized response a status code equal to that given
|
||||
func (o *GetPromptAnswersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers unauthorized response
|
||||
func (o *GetPromptAnswersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersForbidden creates a GetPromptAnswersForbidden with default headers values
|
||||
func NewGetPromptAnswersForbidden() *GetPromptAnswersForbidden {
|
||||
return &GetPromptAnswersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetPromptAnswersForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers forbidden response has a 2xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers forbidden response has a 3xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers forbidden response has a 4xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers forbidden response has a 5xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers forbidden response a status code equal to that given
|
||||
func (o *GetPromptAnswersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers forbidden response
|
||||
func (o *GetPromptAnswersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersNotFound creates a GetPromptAnswersNotFound with default headers values
|
||||
func NewGetPromptAnswersNotFound() *GetPromptAnswersNotFound {
|
||||
return &GetPromptAnswersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetPromptAnswersNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers not found response has a 2xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers not found response has a 3xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers not found response has a 4xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers not found response has a 5xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers not found response a status code equal to that given
|
||||
func (o *GetPromptAnswersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers not found response
|
||||
func (o *GetPromptAnswersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersUnprocessableEntity creates a GetPromptAnswersUnprocessableEntity with default headers values
|
||||
func NewGetPromptAnswersUnprocessableEntity() *GetPromptAnswersUnprocessableEntity {
|
||||
return &GetPromptAnswersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetPromptAnswersUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers unprocessable entity response has a 2xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers unprocessable entity response has a 3xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers unprocessable entity response has a 4xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers unprocessable entity response has a 5xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers unprocessable entity response a status code equal to that given
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers unprocessable entity response
|
||||
func (o *GetPromptAnswersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersInternalServerError creates a GetPromptAnswersInternalServerError with default headers values
|
||||
func NewGetPromptAnswersInternalServerError() *GetPromptAnswersInternalServerError {
|
||||
return &GetPromptAnswersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetPromptAnswersInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers internal server error response has a 2xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers internal server error response has a 3xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers internal server error response has a 4xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers internal server error response has a 5xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers internal server error response a status code equal to that given
|
||||
func (o *GetPromptAnswersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers internal server error response
|
||||
func (o *GetPromptAnswersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostPromptAnswersParams creates a new PostPromptAnswersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostPromptAnswersParams() *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithTimeout creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostPromptAnswersParamsWithTimeout(timeout time.Duration) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithContext creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostPromptAnswersParamsWithContext(ctx context.Context) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithHTTPClient creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostPromptAnswersParamsWithHTTPClient(client *http.Client) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post prompt answers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostPromptAnswersParams struct {
|
||||
|
||||
/* PromptAnswerRequest.
|
||||
|
||||
An array of PromptAnswer objects
|
||||
*/
|
||||
PromptAnswerRequest *members_models.PromptAnswerRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostPromptAnswersParams) WithDefaults() *PostPromptAnswersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostPromptAnswersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithTimeout(timeout time.Duration) *PostPromptAnswersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithContext(ctx context.Context) *PostPromptAnswersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithHTTPClient(client *http.Client) *PostPromptAnswersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithPromptAnswerRequest adds the promptAnswerRequest to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithPromptAnswerRequest(promptAnswerRequest *members_models.PromptAnswerRequest) *PostPromptAnswersParams {
|
||||
o.SetPromptAnswerRequest(promptAnswerRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPromptAnswerRequest adds the promptAnswerRequest to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetPromptAnswerRequest(promptAnswerRequest *members_models.PromptAnswerRequest) {
|
||||
o.PromptAnswerRequest = promptAnswerRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostPromptAnswersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.PromptAnswerRequest != nil {
|
||||
if err := r.SetBodyParam(o.PromptAnswerRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,486 @@
|
|||
// 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
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostPromptAnswersReader is a Reader for the PostPromptAnswers structure.
|
||||
type PostPromptAnswersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostPromptAnswersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostPromptAnswersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostPromptAnswersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostPromptAnswersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostPromptAnswersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostPromptAnswersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostPromptAnswersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersOK creates a PostPromptAnswersOK with default headers values
|
||||
func NewPostPromptAnswersOK() *PostPromptAnswersOK {
|
||||
return &PostPromptAnswersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type PostPromptAnswersOK struct {
|
||||
Payload *members_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers o k response has a 2xx status code
|
||||
func (o *PostPromptAnswersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers o k response has a 3xx status code
|
||||
func (o *PostPromptAnswersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers o k response has a 4xx status code
|
||||
func (o *PostPromptAnswersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers o k response has a 5xx status code
|
||||
func (o *PostPromptAnswersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers o k response a status code equal to that given
|
||||
func (o *PostPromptAnswersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers o k response
|
||||
func (o *PostPromptAnswersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) GetPayload() *members_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersUnauthorized creates a PostPromptAnswersUnauthorized with default headers values
|
||||
func NewPostPromptAnswersUnauthorized() *PostPromptAnswersUnauthorized {
|
||||
return &PostPromptAnswersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostPromptAnswersUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers unauthorized response has a 2xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers unauthorized response has a 3xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers unauthorized response has a 4xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers unauthorized response has a 5xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers unauthorized response a status code equal to that given
|
||||
func (o *PostPromptAnswersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers unauthorized response
|
||||
func (o *PostPromptAnswersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersForbidden creates a PostPromptAnswersForbidden with default headers values
|
||||
func NewPostPromptAnswersForbidden() *PostPromptAnswersForbidden {
|
||||
return &PostPromptAnswersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostPromptAnswersForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers forbidden response has a 2xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers forbidden response has a 3xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers forbidden response has a 4xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers forbidden response has a 5xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers forbidden response a status code equal to that given
|
||||
func (o *PostPromptAnswersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers forbidden response
|
||||
func (o *PostPromptAnswersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersNotFound creates a PostPromptAnswersNotFound with default headers values
|
||||
func NewPostPromptAnswersNotFound() *PostPromptAnswersNotFound {
|
||||
return &PostPromptAnswersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostPromptAnswersNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers not found response has a 2xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers not found response has a 3xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers not found response has a 4xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers not found response has a 5xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers not found response a status code equal to that given
|
||||
func (o *PostPromptAnswersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers not found response
|
||||
func (o *PostPromptAnswersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersUnprocessableEntity creates a PostPromptAnswersUnprocessableEntity with default headers values
|
||||
func NewPostPromptAnswersUnprocessableEntity() *PostPromptAnswersUnprocessableEntity {
|
||||
return &PostPromptAnswersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostPromptAnswersUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers unprocessable entity response has a 2xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers unprocessable entity response has a 3xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers unprocessable entity response has a 4xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers unprocessable entity response has a 5xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers unprocessable entity response a status code equal to that given
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers unprocessable entity response
|
||||
func (o *PostPromptAnswersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersInternalServerError creates a PostPromptAnswersInternalServerError with default headers values
|
||||
func NewPostPromptAnswersInternalServerError() *PostPromptAnswersInternalServerError {
|
||||
return &PostPromptAnswersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostPromptAnswersInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers internal server error response has a 2xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers internal server error response has a 3xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers internal server error response has a 4xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers internal server error response has a 5xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers internal server error response a status code equal to that given
|
||||
func (o *PostPromptAnswersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers internal server error response
|
||||
func (o *PostPromptAnswersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -34,18 +34,24 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error)
|
||||
|
||||
GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error)
|
||||
|
||||
GetPromptTags(params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error)
|
||||
|
||||
GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error)
|
||||
|
||||
PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error)
|
||||
|
||||
PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error)
|
||||
|
||||
PostPromptTags(params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error)
|
||||
|
||||
PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
|
||||
|
||||
PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error)
|
||||
|
||||
PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
||||
|
||||
PutPromptTags(params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error)
|
||||
|
@ -55,6 +61,47 @@ type ClientService interface {
|
|||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswers gets a list of prompt responses
|
||||
|
||||
Return a list of PromptAnswers records from the datastore
|
||||
*/
|
||||
func (a *Client) GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetPromptAnswersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getPromptAnswers",
|
||||
Method: "GET",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetPromptAnswersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetPromptAnswersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getPromptAnswers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptCategories gets a list of prompt categories
|
||||
|
||||
|
@ -178,6 +225,47 @@ func (a *Client) GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAut
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswers creates new prompt responses
|
||||
|
||||
Create PromptAnswers
|
||||
*/
|
||||
func (a *Client) PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostPromptAnswersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postPromptAnswers",
|
||||
Method: "POST",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostPromptAnswersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostPromptAnswersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postPromptAnswers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptCategories creates new prompt categories
|
||||
|
||||
|
@ -301,6 +389,47 @@ func (a *Client) PostPrompts(params *PostPromptsParams, authInfo runtime.ClientA
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweers updates prompt response
|
||||
|
||||
Update PromptAnswers
|
||||
*/
|
||||
func (a *Client) PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutPromptAnsweersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putPromptAnsweers",
|
||||
Method: "PUT",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutPromptAnsweersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutPromptAnsweersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putPromptAnsweers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptCategories updates prompt categories
|
||||
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPutPromptAnsweersParams creates a new PutPromptAnsweersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutPromptAnsweersParams() *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithTimeout creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutPromptAnsweersParamsWithTimeout(timeout time.Duration) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithContext creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPutPromptAnsweersParamsWithContext(ctx context.Context) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithHTTPClient creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPutPromptAnsweersParamsWithHTTPClient(client *http.Client) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the put prompt answeers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PutPromptAnsweersParams struct {
|
||||
|
||||
/* PromptAnswerRequest.
|
||||
|
||||
An array of PromptAnswer objects
|
||||
*/
|
||||
PromptAnswerRequest *members_models.PromptAnswerRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put prompt answeers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutPromptAnsweersParams) WithDefaults() *PutPromptAnsweersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the put prompt answeers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutPromptAnsweersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithTimeout(timeout time.Duration) *PutPromptAnsweersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithContext(ctx context.Context) *PutPromptAnsweersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithHTTPClient(client *http.Client) *PutPromptAnsweersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithPromptAnswerRequest adds the promptAnswerRequest to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithPromptAnswerRequest(promptAnswerRequest *members_models.PromptAnswerRequest) *PutPromptAnsweersParams {
|
||||
o.SetPromptAnswerRequest(promptAnswerRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPromptAnswerRequest adds the promptAnswerRequest to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetPromptAnswerRequest(promptAnswerRequest *members_models.PromptAnswerRequest) {
|
||||
o.PromptAnswerRequest = promptAnswerRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutPromptAnsweersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.PromptAnswerRequest != nil {
|
||||
if err := r.SetBodyParam(o.PromptAnswerRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,486 @@
|
|||
// 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
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PutPromptAnsweersReader is a Reader for the PutPromptAnsweers structure.
|
||||
type PutPromptAnsweersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutPromptAnsweersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutPromptAnsweersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutPromptAnsweersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutPromptAnsweersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutPromptAnsweersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutPromptAnsweersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutPromptAnsweersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersOK creates a PutPromptAnsweersOK with default headers values
|
||||
func NewPutPromptAnsweersOK() *PutPromptAnsweersOK {
|
||||
return &PutPromptAnsweersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type PutPromptAnsweersOK struct {
|
||||
Payload *members_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers o k response has a 2xx status code
|
||||
func (o *PutPromptAnsweersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers o k response has a 3xx status code
|
||||
func (o *PutPromptAnsweersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers o k response has a 4xx status code
|
||||
func (o *PutPromptAnsweersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers o k response has a 5xx status code
|
||||
func (o *PutPromptAnsweersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers o k response a status code equal to that given
|
||||
func (o *PutPromptAnsweersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers o k response
|
||||
func (o *PutPromptAnsweersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) GetPayload() *members_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersUnauthorized creates a PutPromptAnsweersUnauthorized with default headers values
|
||||
func NewPutPromptAnsweersUnauthorized() *PutPromptAnsweersUnauthorized {
|
||||
return &PutPromptAnsweersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutPromptAnsweersUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers unauthorized response has a 2xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers unauthorized response has a 3xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers unauthorized response has a 4xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers unauthorized response has a 5xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers unauthorized response a status code equal to that given
|
||||
func (o *PutPromptAnsweersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers unauthorized response
|
||||
func (o *PutPromptAnsweersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersForbidden creates a PutPromptAnsweersForbidden with default headers values
|
||||
func NewPutPromptAnsweersForbidden() *PutPromptAnsweersForbidden {
|
||||
return &PutPromptAnsweersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutPromptAnsweersForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers forbidden response has a 2xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers forbidden response has a 3xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers forbidden response has a 4xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers forbidden response has a 5xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers forbidden response a status code equal to that given
|
||||
func (o *PutPromptAnsweersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers forbidden response
|
||||
func (o *PutPromptAnsweersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersNotFound creates a PutPromptAnsweersNotFound with default headers values
|
||||
func NewPutPromptAnsweersNotFound() *PutPromptAnsweersNotFound {
|
||||
return &PutPromptAnsweersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutPromptAnsweersNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers not found response has a 2xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers not found response has a 3xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers not found response has a 4xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers not found response has a 5xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers not found response a status code equal to that given
|
||||
func (o *PutPromptAnsweersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers not found response
|
||||
func (o *PutPromptAnsweersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersUnprocessableEntity creates a PutPromptAnsweersUnprocessableEntity with default headers values
|
||||
func NewPutPromptAnsweersUnprocessableEntity() *PutPromptAnsweersUnprocessableEntity {
|
||||
return &PutPromptAnsweersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutPromptAnsweersUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers unprocessable entity response has a 2xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers unprocessable entity response has a 3xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers unprocessable entity response has a 4xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers unprocessable entity response has a 5xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers unprocessable entity response a status code equal to that given
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers unprocessable entity response
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersInternalServerError creates a PutPromptAnsweersInternalServerError with default headers values
|
||||
func NewPutPromptAnsweersInternalServerError() *PutPromptAnsweersInternalServerError {
|
||||
return &PutPromptAnsweersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutPromptAnsweersInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers internal server error response has a 2xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers internal server error response has a 3xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers internal server error response has a 4xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers internal server error response has a 5xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers internal server error response a status code equal to that given
|
||||
func (o *PutPromptAnsweersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers internal server error response
|
||||
func (o *PutPromptAnsweersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -48,6 +48,18 @@ type Prompt struct {
|
|||
// The logo for the prompt
|
||||
Logo *string `json:"Logo,omitempty"`
|
||||
|
||||
// The model for the prompt
|
||||
Model *string `json:"Model,omitempty"`
|
||||
|
||||
// The name of the prompt
|
||||
Name *string `json:"Name,omitempty"`
|
||||
|
||||
// The order of the prompt
|
||||
Order *float64 `json:"Order,omitempty"`
|
||||
|
||||
// A list of parameters encoded as JSON
|
||||
Parameters *string `json:"Parameters,omitempty"`
|
||||
|
||||
// The prompt text
|
||||
Prompt *string `json:"Prompt,omitempty"`
|
||||
|
||||
|
@ -60,9 +72,15 @@ type Prompt struct {
|
|||
// The slug for the prompt
|
||||
Slug *string `json:"Slug,omitempty"`
|
||||
|
||||
// The System prompt to be used
|
||||
System *string `json:"System,omitempty"`
|
||||
|
||||
// A list of tags
|
||||
Tags []string `json:"Tags"`
|
||||
|
||||
// The temperature of the prompt
|
||||
Temperature *float64 `json:"Temperature,omitempty"`
|
||||
|
||||
// The ID of the tenant
|
||||
TenantID *string `json:"TenantID,omitempty"`
|
||||
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
// 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 members_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswer A prompt response/answer
|
||||
//
|
||||
// swagger:model promptAnswer
|
||||
type PromptAnswer struct {
|
||||
|
||||
// The answer to the prompt
|
||||
Answer *string `json:"Answer,omitempty"`
|
||||
|
||||
// The ID of the user who created the prompt tag
|
||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// The date the prompt tag was created
|
||||
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// The ID of the user who last modified the prompt tag
|
||||
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// The date the prompt tag was last modified
|
||||
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// The name of the Answer
|
||||
Name *string `json:"Name,omitempty"`
|
||||
|
||||
// The prompt tag name
|
||||
ParameterValues *string `json:"ParameterValues,omitempty"`
|
||||
|
||||
// The ID of the prompt
|
||||
PromptID *string `json:"PromptID,omitempty"`
|
||||
|
||||
// The prompt used
|
||||
PromptUsed *string `json:"PromptUsed,omitempty"`
|
||||
|
||||
// The system used
|
||||
SystemUsed *string `json:"SystemUsed,omitempty"`
|
||||
|
||||
// The temperature used
|
||||
Temperature *float64 `json:"Temperature,omitempty"`
|
||||
|
||||
// The ID of the tenant
|
||||
TenantID *string `json:"TenantID,omitempty"`
|
||||
|
||||
// The tokens used
|
||||
TokensUsed *float64 `json:"TokensUsed,omitempty"`
|
||||
|
||||
// The type of answer to the prompt
|
||||
Type *string `json:"Type,omitempty"`
|
||||
|
||||
// The ID of the user
|
||||
UserID *string `json:"UserID,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer
|
||||
func (m *PromptAnswer) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this prompt answer based on context it is used
|
||||
func (m *PromptAnswer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswer) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswer) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswer
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
// 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 members_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswerRequest An array of Prompt objects
|
||||
//
|
||||
// swagger:model PromptAnswerRequest
|
||||
type PromptAnswerRequest struct {
|
||||
|
||||
// data
|
||||
Data []*PromptAnswer `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer request
|
||||
func (m *PromptAnswerRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this prompt answer request based on the context it is used
|
||||
func (m *PromptAnswerRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswerRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswerRequest) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswerRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
// 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 members_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswerResponse An array of PromptResponse objects
|
||||
//
|
||||
// swagger:model PromptAnswerResponse
|
||||
type PromptAnswerResponse struct {
|
||||
|
||||
// data
|
||||
Data []*PromptAnswer `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer response
|
||||
func (m *PromptAnswerResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this prompt answer response based on the context it is used
|
||||
func (m *PromptAnswerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateMeta(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswerResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswerResponse) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswerResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,240 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetPromptAnswersParams creates a new GetPromptAnswersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetPromptAnswersParams() *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithTimeout creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetPromptAnswersParamsWithTimeout(timeout time.Duration) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithContext creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetPromptAnswersParamsWithContext(ctx context.Context) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersParamsWithHTTPClient creates a new GetPromptAnswersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetPromptAnswersParamsWithHTTPClient(client *http.Client) *GetPromptAnswersParams {
|
||||
return &GetPromptAnswersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get prompt answers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetPromptAnswersParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPromptAnswersParams) WithDefaults() *GetPromptAnswersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPromptAnswersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithTimeout(timeout time.Duration) *GetPromptAnswersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithContext(ctx context.Context) *GetPromptAnswersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithHTTPClient(client *http.Client) *GetPromptAnswersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithID(id *string) *GetPromptAnswersParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithLimit(limit *int64) *GetPromptAnswersParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) WithOffset(offset *int64) *GetPromptAnswersParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get prompt answers params
|
||||
func (o *GetPromptAnswersParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetPromptAnswersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,477 @@
|
|||
// 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
|
||||
|
||||
// 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/sfgate/sfgate_models"
|
||||
)
|
||||
|
||||
// GetPromptAnswersReader is a Reader for the GetPromptAnswers structure.
|
||||
type GetPromptAnswersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetPromptAnswersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetPromptAnswersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetPromptAnswersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetPromptAnswersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetPromptAnswersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetPromptAnswersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetPromptAnswersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersOK creates a GetPromptAnswersOK with default headers values
|
||||
func NewGetPromptAnswersOK() *GetPromptAnswersOK {
|
||||
return &GetPromptAnswersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type GetPromptAnswersOK struct {
|
||||
Payload *sfgate_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers o k response has a 2xx status code
|
||||
func (o *GetPromptAnswersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers o k response has a 3xx status code
|
||||
func (o *GetPromptAnswersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers o k response has a 4xx status code
|
||||
func (o *GetPromptAnswersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers o k response has a 5xx status code
|
||||
func (o *GetPromptAnswersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers o k response a status code equal to that given
|
||||
func (o *GetPromptAnswersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers o k response
|
||||
func (o *GetPromptAnswersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) GetPayload() *sfgate_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(sfgate_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersUnauthorized creates a GetPromptAnswersUnauthorized with default headers values
|
||||
func NewGetPromptAnswersUnauthorized() *GetPromptAnswersUnauthorized {
|
||||
return &GetPromptAnswersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetPromptAnswersUnauthorized struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers unauthorized response has a 2xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers unauthorized response has a 3xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers unauthorized response has a 4xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers unauthorized response has a 5xx status code
|
||||
func (o *GetPromptAnswersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers unauthorized response a status code equal to that given
|
||||
func (o *GetPromptAnswersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers unauthorized response
|
||||
func (o *GetPromptAnswersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnauthorized) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersForbidden creates a GetPromptAnswersForbidden with default headers values
|
||||
func NewGetPromptAnswersForbidden() *GetPromptAnswersForbidden {
|
||||
return &GetPromptAnswersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetPromptAnswersForbidden struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers forbidden response has a 2xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers forbidden response has a 3xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers forbidden response has a 4xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers forbidden response has a 5xx status code
|
||||
func (o *GetPromptAnswersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers forbidden response a status code equal to that given
|
||||
func (o *GetPromptAnswersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers forbidden response
|
||||
func (o *GetPromptAnswersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersForbidden) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersNotFound creates a GetPromptAnswersNotFound with default headers values
|
||||
func NewGetPromptAnswersNotFound() *GetPromptAnswersNotFound {
|
||||
return &GetPromptAnswersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetPromptAnswersNotFound struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers not found response has a 2xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers not found response has a 3xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers not found response has a 4xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers not found response has a 5xx status code
|
||||
func (o *GetPromptAnswersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers not found response a status code equal to that given
|
||||
func (o *GetPromptAnswersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers not found response
|
||||
func (o *GetPromptAnswersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersNotFound) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersUnprocessableEntity creates a GetPromptAnswersUnprocessableEntity with default headers values
|
||||
func NewGetPromptAnswersUnprocessableEntity() *GetPromptAnswersUnprocessableEntity {
|
||||
return &GetPromptAnswersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetPromptAnswersUnprocessableEntity struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers unprocessable entity response has a 2xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers unprocessable entity response has a 3xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers unprocessable entity response has a 4xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers unprocessable entity response has a 5xx status code
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers unprocessable entity response a status code equal to that given
|
||||
func (o *GetPromptAnswersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers unprocessable entity response
|
||||
func (o *GetPromptAnswersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersUnprocessableEntity) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPromptAnswersInternalServerError creates a GetPromptAnswersInternalServerError with default headers values
|
||||
func NewGetPromptAnswersInternalServerError() *GetPromptAnswersInternalServerError {
|
||||
return &GetPromptAnswersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetPromptAnswersInternalServerError struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get prompt answers internal server error response has a 2xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get prompt answers internal server error response has a 3xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get prompt answers internal server error response has a 4xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get prompt answers internal server error response has a 5xx status code
|
||||
func (o *GetPromptAnswersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get prompt answers internal server error response a status code equal to that given
|
||||
func (o *GetPromptAnswersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get prompt answers internal server error response
|
||||
func (o *GetPromptAnswersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /promptanswers][%d] getPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPromptAnswersInternalServerError) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
|
||||
)
|
||||
|
||||
// NewPostPromptAnswersParams creates a new PostPromptAnswersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostPromptAnswersParams() *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithTimeout creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostPromptAnswersParamsWithTimeout(timeout time.Duration) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithContext creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostPromptAnswersParamsWithContext(ctx context.Context) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersParamsWithHTTPClient creates a new PostPromptAnswersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostPromptAnswersParamsWithHTTPClient(client *http.Client) *PostPromptAnswersParams {
|
||||
return &PostPromptAnswersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post prompt answers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostPromptAnswersParams struct {
|
||||
|
||||
/* PromptAnswerRequest.
|
||||
|
||||
An array of PromptAnswer objects
|
||||
*/
|
||||
PromptAnswerRequest *sfgate_models.PromptAnswerRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostPromptAnswersParams) WithDefaults() *PostPromptAnswersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post prompt answers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostPromptAnswersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithTimeout(timeout time.Duration) *PostPromptAnswersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithContext(ctx context.Context) *PostPromptAnswersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithHTTPClient(client *http.Client) *PostPromptAnswersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithPromptAnswerRequest adds the promptAnswerRequest to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) WithPromptAnswerRequest(promptAnswerRequest *sfgate_models.PromptAnswerRequest) *PostPromptAnswersParams {
|
||||
o.SetPromptAnswerRequest(promptAnswerRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPromptAnswerRequest adds the promptAnswerRequest to the post prompt answers params
|
||||
func (o *PostPromptAnswersParams) SetPromptAnswerRequest(promptAnswerRequest *sfgate_models.PromptAnswerRequest) {
|
||||
o.PromptAnswerRequest = promptAnswerRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostPromptAnswersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.PromptAnswerRequest != nil {
|
||||
if err := r.SetBodyParam(o.PromptAnswerRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,477 @@
|
|||
// 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
|
||||
|
||||
// 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/sfgate/sfgate_models"
|
||||
)
|
||||
|
||||
// PostPromptAnswersReader is a Reader for the PostPromptAnswers structure.
|
||||
type PostPromptAnswersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostPromptAnswersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostPromptAnswersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostPromptAnswersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostPromptAnswersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostPromptAnswersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostPromptAnswersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostPromptAnswersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersOK creates a PostPromptAnswersOK with default headers values
|
||||
func NewPostPromptAnswersOK() *PostPromptAnswersOK {
|
||||
return &PostPromptAnswersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type PostPromptAnswersOK struct {
|
||||
Payload *sfgate_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers o k response has a 2xx status code
|
||||
func (o *PostPromptAnswersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers o k response has a 3xx status code
|
||||
func (o *PostPromptAnswersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers o k response has a 4xx status code
|
||||
func (o *PostPromptAnswersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers o k response has a 5xx status code
|
||||
func (o *PostPromptAnswersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers o k response a status code equal to that given
|
||||
func (o *PostPromptAnswersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers o k response
|
||||
func (o *PostPromptAnswersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) GetPayload() *sfgate_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(sfgate_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersUnauthorized creates a PostPromptAnswersUnauthorized with default headers values
|
||||
func NewPostPromptAnswersUnauthorized() *PostPromptAnswersUnauthorized {
|
||||
return &PostPromptAnswersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostPromptAnswersUnauthorized struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers unauthorized response has a 2xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers unauthorized response has a 3xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers unauthorized response has a 4xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers unauthorized response has a 5xx status code
|
||||
func (o *PostPromptAnswersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers unauthorized response a status code equal to that given
|
||||
func (o *PostPromptAnswersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers unauthorized response
|
||||
func (o *PostPromptAnswersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnauthorized) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersForbidden creates a PostPromptAnswersForbidden with default headers values
|
||||
func NewPostPromptAnswersForbidden() *PostPromptAnswersForbidden {
|
||||
return &PostPromptAnswersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostPromptAnswersForbidden struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers forbidden response has a 2xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers forbidden response has a 3xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers forbidden response has a 4xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers forbidden response has a 5xx status code
|
||||
func (o *PostPromptAnswersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers forbidden response a status code equal to that given
|
||||
func (o *PostPromptAnswersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers forbidden response
|
||||
func (o *PostPromptAnswersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersForbidden) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersNotFound creates a PostPromptAnswersNotFound with default headers values
|
||||
func NewPostPromptAnswersNotFound() *PostPromptAnswersNotFound {
|
||||
return &PostPromptAnswersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostPromptAnswersNotFound struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers not found response has a 2xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers not found response has a 3xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers not found response has a 4xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers not found response has a 5xx status code
|
||||
func (o *PostPromptAnswersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers not found response a status code equal to that given
|
||||
func (o *PostPromptAnswersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers not found response
|
||||
func (o *PostPromptAnswersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersNotFound) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersUnprocessableEntity creates a PostPromptAnswersUnprocessableEntity with default headers values
|
||||
func NewPostPromptAnswersUnprocessableEntity() *PostPromptAnswersUnprocessableEntity {
|
||||
return &PostPromptAnswersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostPromptAnswersUnprocessableEntity struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers unprocessable entity response has a 2xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers unprocessable entity response has a 3xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers unprocessable entity response has a 4xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers unprocessable entity response has a 5xx status code
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers unprocessable entity response a status code equal to that given
|
||||
func (o *PostPromptAnswersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers unprocessable entity response
|
||||
func (o *PostPromptAnswersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersUnprocessableEntity) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostPromptAnswersInternalServerError creates a PostPromptAnswersInternalServerError with default headers values
|
||||
func NewPostPromptAnswersInternalServerError() *PostPromptAnswersInternalServerError {
|
||||
return &PostPromptAnswersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostPromptAnswersInternalServerError struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post prompt answers internal server error response has a 2xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post prompt answers internal server error response has a 3xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post prompt answers internal server error response has a 4xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post prompt answers internal server error response has a 5xx status code
|
||||
func (o *PostPromptAnswersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post prompt answers internal server error response a status code equal to that given
|
||||
func (o *PostPromptAnswersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post prompt answers internal server error response
|
||||
func (o *PostPromptAnswersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /promptanswers][%d] postPromptAnswersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostPromptAnswersInternalServerError) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -34,18 +34,24 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error)
|
||||
|
||||
GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error)
|
||||
|
||||
GetPromptTags(params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error)
|
||||
|
||||
GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error)
|
||||
|
||||
PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error)
|
||||
|
||||
PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error)
|
||||
|
||||
PostPromptTags(params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error)
|
||||
|
||||
PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
|
||||
|
||||
PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error)
|
||||
|
||||
PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
||||
|
||||
PutPromptTags(params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error)
|
||||
|
@ -55,6 +61,47 @@ type ClientService interface {
|
|||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptAnswers gets a list of prompt responses
|
||||
|
||||
Return a list of PromptAnswers records from the datastore
|
||||
*/
|
||||
func (a *Client) GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetPromptAnswersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getPromptAnswers",
|
||||
Method: "GET",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetPromptAnswersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetPromptAnswersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getPromptAnswers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPromptCategories gets a list of prompt categories
|
||||
|
||||
|
@ -178,6 +225,47 @@ func (a *Client) GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAut
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptAnswers creates new prompt responses
|
||||
|
||||
Create PromptAnswers
|
||||
*/
|
||||
func (a *Client) PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostPromptAnswersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postPromptAnswers",
|
||||
Method: "POST",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostPromptAnswersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostPromptAnswersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postPromptAnswers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostPromptCategories creates new prompt categories
|
||||
|
||||
|
@ -301,6 +389,47 @@ func (a *Client) PostPrompts(params *PostPromptsParams, authInfo runtime.ClientA
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweers updates prompt response
|
||||
|
||||
Update PromptAnswers
|
||||
*/
|
||||
func (a *Client) PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutPromptAnsweersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putPromptAnsweers",
|
||||
Method: "PUT",
|
||||
PathPattern: "/promptanswers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutPromptAnsweersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutPromptAnsweersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putPromptAnsweers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptCategories updates prompt categories
|
||||
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
// 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
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
|
||||
)
|
||||
|
||||
// NewPutPromptAnsweersParams creates a new PutPromptAnsweersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutPromptAnsweersParams() *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithTimeout creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutPromptAnsweersParamsWithTimeout(timeout time.Duration) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithContext creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPutPromptAnsweersParamsWithContext(ctx context.Context) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersParamsWithHTTPClient creates a new PutPromptAnsweersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPutPromptAnsweersParamsWithHTTPClient(client *http.Client) *PutPromptAnsweersParams {
|
||||
return &PutPromptAnsweersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the put prompt answeers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PutPromptAnsweersParams struct {
|
||||
|
||||
/* PromptAnswerRequest.
|
||||
|
||||
An array of PromptAnswer objects
|
||||
*/
|
||||
PromptAnswerRequest *sfgate_models.PromptAnswerRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put prompt answeers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutPromptAnsweersParams) WithDefaults() *PutPromptAnsweersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the put prompt answeers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutPromptAnsweersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithTimeout(timeout time.Duration) *PutPromptAnsweersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithContext(ctx context.Context) *PutPromptAnsweersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithHTTPClient(client *http.Client) *PutPromptAnsweersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithPromptAnswerRequest adds the promptAnswerRequest to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) WithPromptAnswerRequest(promptAnswerRequest *sfgate_models.PromptAnswerRequest) *PutPromptAnsweersParams {
|
||||
o.SetPromptAnswerRequest(promptAnswerRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPromptAnswerRequest adds the promptAnswerRequest to the put prompt answeers params
|
||||
func (o *PutPromptAnsweersParams) SetPromptAnswerRequest(promptAnswerRequest *sfgate_models.PromptAnswerRequest) {
|
||||
o.PromptAnswerRequest = promptAnswerRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutPromptAnsweersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.PromptAnswerRequest != nil {
|
||||
if err := r.SetBodyParam(o.PromptAnswerRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,477 @@
|
|||
// 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
|
||||
|
||||
// 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/sfgate/sfgate_models"
|
||||
)
|
||||
|
||||
// PutPromptAnsweersReader is a Reader for the PutPromptAnsweers structure.
|
||||
type PutPromptAnsweersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutPromptAnsweersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutPromptAnsweersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutPromptAnsweersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutPromptAnsweersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutPromptAnsweersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutPromptAnsweersUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutPromptAnsweersInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersOK creates a PutPromptAnsweersOK with default headers values
|
||||
func NewPutPromptAnsweersOK() *PutPromptAnsweersOK {
|
||||
return &PutPromptAnsweersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with PromptAnswer objects
|
||||
*/
|
||||
type PutPromptAnsweersOK struct {
|
||||
Payload *sfgate_models.PromptAnswerResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers o k response has a 2xx status code
|
||||
func (o *PutPromptAnsweersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers o k response has a 3xx status code
|
||||
func (o *PutPromptAnsweersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers o k response has a 4xx status code
|
||||
func (o *PutPromptAnsweersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers o k response has a 5xx status code
|
||||
func (o *PutPromptAnsweersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers o k response a status code equal to that given
|
||||
func (o *PutPromptAnsweersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers o k response
|
||||
func (o *PutPromptAnsweersOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) GetPayload() *sfgate_models.PromptAnswerResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(sfgate_models.PromptAnswerResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersUnauthorized creates a PutPromptAnsweersUnauthorized with default headers values
|
||||
func NewPutPromptAnsweersUnauthorized() *PutPromptAnsweersUnauthorized {
|
||||
return &PutPromptAnsweersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutPromptAnsweersUnauthorized struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers unauthorized response has a 2xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers unauthorized response has a 3xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers unauthorized response has a 4xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers unauthorized response has a 5xx status code
|
||||
func (o *PutPromptAnsweersUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers unauthorized response a status code equal to that given
|
||||
func (o *PutPromptAnsweersUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers unauthorized response
|
||||
func (o *PutPromptAnsweersUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnauthorized) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersForbidden creates a PutPromptAnsweersForbidden with default headers values
|
||||
func NewPutPromptAnsweersForbidden() *PutPromptAnsweersForbidden {
|
||||
return &PutPromptAnsweersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutPromptAnsweersForbidden struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers forbidden response has a 2xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers forbidden response has a 3xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers forbidden response has a 4xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers forbidden response has a 5xx status code
|
||||
func (o *PutPromptAnsweersForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers forbidden response a status code equal to that given
|
||||
func (o *PutPromptAnsweersForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers forbidden response
|
||||
func (o *PutPromptAnsweersForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersForbidden) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersNotFound creates a PutPromptAnsweersNotFound with default headers values
|
||||
func NewPutPromptAnsweersNotFound() *PutPromptAnsweersNotFound {
|
||||
return &PutPromptAnsweersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutPromptAnsweersNotFound struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers not found response has a 2xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers not found response has a 3xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers not found response has a 4xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers not found response has a 5xx status code
|
||||
func (o *PutPromptAnsweersNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers not found response a status code equal to that given
|
||||
func (o *PutPromptAnsweersNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers not found response
|
||||
func (o *PutPromptAnsweersNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersNotFound) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersUnprocessableEntity creates a PutPromptAnsweersUnprocessableEntity with default headers values
|
||||
func NewPutPromptAnsweersUnprocessableEntity() *PutPromptAnsweersUnprocessableEntity {
|
||||
return &PutPromptAnsweersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutPromptAnsweersUnprocessableEntity struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers unprocessable entity response has a 2xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers unprocessable entity response has a 3xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers unprocessable entity response has a 4xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers unprocessable entity response has a 5xx status code
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers unprocessable entity response a status code equal to that given
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers unprocessable entity response
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersUnprocessableEntity) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutPromptAnsweersInternalServerError creates a PutPromptAnsweersInternalServerError with default headers values
|
||||
func NewPutPromptAnsweersInternalServerError() *PutPromptAnsweersInternalServerError {
|
||||
return &PutPromptAnsweersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutPromptAnsweersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutPromptAnsweersInternalServerError struct {
|
||||
Payload *sfgate_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put prompt answeers internal server error response has a 2xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put prompt answeers internal server error response has a 3xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put prompt answeers internal server error response has a 4xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put prompt answeers internal server error response has a 5xx status code
|
||||
func (o *PutPromptAnsweersInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this put prompt answeers internal server error response a status code equal to that given
|
||||
func (o *PutPromptAnsweersInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the put prompt answeers internal server error response
|
||||
func (o *PutPromptAnsweersInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) GetPayload() *sfgate_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutPromptAnsweersInternalServerError) 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 && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -48,6 +48,18 @@ type Prompt struct {
|
|||
// The logo for the prompt
|
||||
Logo *string `json:"Logo,omitempty"`
|
||||
|
||||
// The model for the prompt
|
||||
Model *string `json:"Model,omitempty"`
|
||||
|
||||
// The name of the prompt
|
||||
Name *string `json:"Name,omitempty"`
|
||||
|
||||
// The order of the prompt
|
||||
Order *float64 `json:"Order,omitempty"`
|
||||
|
||||
// A list of parameters encoded as JSON
|
||||
Parameters *string `json:"Parameters,omitempty"`
|
||||
|
||||
// The prompt text
|
||||
Prompt *string `json:"Prompt,omitempty"`
|
||||
|
||||
|
@ -60,9 +72,15 @@ type Prompt struct {
|
|||
// The slug for the prompt
|
||||
Slug *string `json:"Slug,omitempty"`
|
||||
|
||||
// The System prompt to be used
|
||||
System *string `json:"System,omitempty"`
|
||||
|
||||
// A list of tags
|
||||
Tags []string `json:"Tags"`
|
||||
|
||||
// The temperature of the prompt
|
||||
Temperature *float64 `json:"Temperature,omitempty"`
|
||||
|
||||
// The ID of the tenant
|
||||
TenantID *string `json:"TenantID,omitempty"`
|
||||
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
// 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 sfgate_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswer A prompt response/answer
|
||||
//
|
||||
// swagger:model promptAnswer
|
||||
type PromptAnswer struct {
|
||||
|
||||
// The answer to the prompt
|
||||
Answer *string `json:"Answer,omitempty"`
|
||||
|
||||
// The ID of the user who created the prompt tag
|
||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// The date the prompt tag was created
|
||||
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// The ID of the user who last modified the prompt tag
|
||||
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// The date the prompt tag was last modified
|
||||
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// The name of the Answer
|
||||
Name *string `json:"Name,omitempty"`
|
||||
|
||||
// The prompt tag name
|
||||
ParameterValues *string `json:"ParameterValues,omitempty"`
|
||||
|
||||
// The ID of the prompt
|
||||
PromptID *string `json:"PromptID,omitempty"`
|
||||
|
||||
// The prompt used
|
||||
PromptUsed *string `json:"PromptUsed,omitempty"`
|
||||
|
||||
// The system used
|
||||
SystemUsed *string `json:"SystemUsed,omitempty"`
|
||||
|
||||
// The temperature used
|
||||
Temperature *float64 `json:"Temperature,omitempty"`
|
||||
|
||||
// The ID of the tenant
|
||||
TenantID *string `json:"TenantID,omitempty"`
|
||||
|
||||
// The tokens used
|
||||
TokensUsed *float64 `json:"TokensUsed,omitempty"`
|
||||
|
||||
// The type of answer to the prompt
|
||||
Type *string `json:"Type,omitempty"`
|
||||
|
||||
// The ID of the user
|
||||
UserID *string `json:"UserID,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer
|
||||
func (m *PromptAnswer) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this prompt answer based on context it is used
|
||||
func (m *PromptAnswer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswer) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswer) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswer
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
// 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 sfgate_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswerRequest An array of Prompt objects
|
||||
//
|
||||
// swagger:model PromptAnswerRequest
|
||||
type PromptAnswerRequest struct {
|
||||
|
||||
// data
|
||||
Data []*PromptAnswer `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer request
|
||||
func (m *PromptAnswerRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this prompt answer request based on the context it is used
|
||||
func (m *PromptAnswerRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswerRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswerRequest) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswerRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
// 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 sfgate_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// PromptAnswerResponse An array of PromptResponse objects
|
||||
//
|
||||
// swagger:model PromptAnswerResponse
|
||||
type PromptAnswerResponse struct {
|
||||
|
||||
// data
|
||||
Data []*PromptAnswer `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer response
|
||||
func (m *PromptAnswerResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this prompt answer response based on the context it is used
|
||||
func (m *PromptAnswerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswerResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PromptAnswerResponse) UnmarshalBinary(b []byte) error {
|
||||
var res PromptAnswerResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
PromptAnswer:
|
||||
description: A prompt response/answer
|
||||
properties:
|
||||
ID:
|
||||
description: Record Id
|
||||
type: string
|
||||
Answer:
|
||||
description: The answer to the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
CreatedDate:
|
||||
description: The date the prompt tag was created
|
||||
type: string
|
||||
x-nullable: true
|
||||
CreatedByID:
|
||||
description: The ID of the user who created the prompt tag
|
||||
type: string
|
||||
x-nullable: true
|
||||
LastModifiedDate:
|
||||
description: The date the prompt tag was last modified
|
||||
type: string
|
||||
x-nullable: true
|
||||
LastModifiedByID:
|
||||
description: The ID of the user who last modified the prompt tag
|
||||
type: string
|
||||
x-nullable: true
|
||||
Name:
|
||||
description: The name of the Answer
|
||||
type: string
|
||||
x-nullable: true
|
||||
ParameterValues:
|
||||
description: The prompt tag name
|
||||
type: string
|
||||
x-nullable: true
|
||||
PromptID:
|
||||
description: The ID of the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
PromptUsed:
|
||||
description: The prompt used
|
||||
type: string
|
||||
x-nullable: true
|
||||
SystemUsed:
|
||||
description: The system used
|
||||
type: string
|
||||
x-nullable: true
|
||||
Temperature:
|
||||
description: The temperature used
|
||||
type: number
|
||||
x-nullable: true
|
||||
TokensUsed:
|
||||
description: The tokens used
|
||||
type: number
|
||||
x-nullable: true
|
||||
Type:
|
||||
description: The type of answer to the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
TenantID:
|
||||
description: The ID of the tenant
|
||||
type: string
|
||||
x-nullable: true
|
||||
UserID:
|
||||
description: The ID of the user
|
||||
type: string
|
||||
x-nullable: true
|
||||
type: object
|
|
@ -36,6 +36,22 @@ Prompt:
|
|||
description: The logo for the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
Model:
|
||||
description: The model for the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
Name:
|
||||
description: The name of the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
Order:
|
||||
description: The order of the prompt
|
||||
type: number
|
||||
x-nullable: true
|
||||
Parameters:
|
||||
description: A list of parameters encoded as JSON
|
||||
type: string
|
||||
x-nullable: true
|
||||
Prompt:
|
||||
description: The prompt text
|
||||
type: string
|
||||
|
@ -54,12 +70,20 @@ Prompt:
|
|||
description: The slug for the prompt
|
||||
type: string
|
||||
x-nullable: true
|
||||
System:
|
||||
description: The System prompt to be used
|
||||
type: string
|
||||
x-nullable: true
|
||||
Tags:
|
||||
description: A list of tags
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-nullable: true
|
||||
Temperature:
|
||||
description: The temperature of the prompt
|
||||
type: number
|
||||
x-nullable: true
|
||||
TenantID:
|
||||
description: The ID of the tenant
|
||||
type: string
|
||||
|
|
|
@ -167,6 +167,13 @@ parameters:
|
|||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptTagRequest"
|
||||
PromptAnswerRequest:
|
||||
description: An array of PromptAnswer objects
|
||||
name: promptAnswerRequest
|
||||
required: true
|
||||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerRequest"
|
||||
ResearchProjectCompanyRequest:
|
||||
description: An array of new ResearchProjectCompany records
|
||||
in: body
|
||||
|
@ -451,6 +458,10 @@ responses:
|
|||
description: Response with PromptCategory objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryResponse"
|
||||
PromptAnswerResponse:
|
||||
description: Response with PromptAnswer objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerResponse"
|
||||
PromptTagResponse:
|
||||
description: Response with PromptTag objects
|
||||
schema:
|
||||
|
@ -1852,6 +1863,78 @@ paths:
|
|||
summary: Update Prompts
|
||||
tags:
|
||||
- Prompts
|
||||
/promptanswers:
|
||||
get:
|
||||
description: Return a list of PromptAnswers records from the datastore
|
||||
operationId: getPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Get a list of PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
post:
|
||||
description: Create PromptAnswers
|
||||
operationId: postPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Create new PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
put:
|
||||
description: Update PromptAnswers
|
||||
operationId: putPromptAnsweers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Update PromptResponse
|
||||
tags:
|
||||
- Prompts
|
||||
/promptcategories:
|
||||
get:
|
||||
description: Return a list of PromptCategory records from the datastore
|
||||
|
@ -3187,6 +3270,24 @@ definitions:
|
|||
$ref: "../../lib/swagger/defs/payment-method.yaml#/PaymentMethod"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerResponse:
|
||||
description: An array of PromptResponse objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
type: object
|
||||
PromptRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
|
|
|
@ -337,6 +337,13 @@ parameters:
|
|||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryRequest"
|
||||
PromptAnswerRequest:
|
||||
description: An array of PromptAnswer objects
|
||||
name: promptAnswerRequest
|
||||
required: true
|
||||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerRequest"
|
||||
PromptTagRequest:
|
||||
description: An array of PromptTag objects
|
||||
name: promptTagRequest
|
||||
|
@ -533,6 +540,10 @@ responses:
|
|||
description: Response with PromptCategory objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryResponse"
|
||||
PromptAnswerResponse:
|
||||
description: Response with PromptAnswer objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerResponse"
|
||||
PromptTagResponse:
|
||||
description: Response with PromptTag objects
|
||||
schema:
|
||||
|
@ -1882,6 +1893,78 @@ paths:
|
|||
summary: Add a new Observation
|
||||
tags:
|
||||
- Observations
|
||||
/promptanswers:
|
||||
get:
|
||||
description: Return a list of PromptAnswers records from the datastore
|
||||
operationId: getPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Get a list of PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
post:
|
||||
description: Create PromptAnswers
|
||||
operationId: postPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Create new PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
put:
|
||||
description: Update PromptAnswers
|
||||
operationId: putPromptAnsweers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Update PromptResponse
|
||||
tags:
|
||||
- Prompts
|
||||
/prompts:
|
||||
get:
|
||||
description: Return a list of Prompt records from the datastore
|
||||
|
@ -4510,6 +4593,22 @@ definitions:
|
|||
format: int64
|
||||
type: number
|
||||
type: object
|
||||
PromptAnswerRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerResponse:
|
||||
description: An array of PromptResponse objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
RequestMeta:
|
||||
properties:
|
||||
ExternalAccount:
|
||||
|
|
|
@ -167,6 +167,13 @@ parameters:
|
|||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptTagRequest"
|
||||
PromptAnswerRequest:
|
||||
description: An array of PromptAnswer objects
|
||||
name: promptAnswerRequest
|
||||
required: true
|
||||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerRequest"
|
||||
ResearchProjectCompanyRequest:
|
||||
description: An array of new ResearchProjectCompany records
|
||||
in: body
|
||||
|
@ -451,6 +458,10 @@ responses:
|
|||
description: Response with PromptCategory objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryResponse"
|
||||
PromptAnswerResponse:
|
||||
description: Response with PromptAnswer objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerResponse"
|
||||
PromptTagResponse:
|
||||
description: Response with PromptTag objects
|
||||
schema:
|
||||
|
@ -1852,6 +1863,78 @@ paths:
|
|||
summary: Update Prompts
|
||||
tags:
|
||||
- Prompts
|
||||
/promptanswers:
|
||||
get:
|
||||
description: Return a list of PromptAnswers records from the datastore
|
||||
operationId: getPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Get a list of PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
post:
|
||||
description: Create PromptAnswers
|
||||
operationId: postPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Create new PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
put:
|
||||
description: Update PromptAnswers
|
||||
operationId: putPromptAnsweers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Update PromptResponse
|
||||
tags:
|
||||
- Prompts
|
||||
/promptcategories:
|
||||
get:
|
||||
description: Return a list of PromptCategory records from the datastore
|
||||
|
@ -3187,6 +3270,24 @@ definitions:
|
|||
$ref: "../../lib/swagger/defs/payment-method.yaml#/PaymentMethod"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerResponse:
|
||||
description: An array of PromptResponse objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
type: object
|
||||
PromptRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
|
|
|
@ -337,6 +337,13 @@ parameters:
|
|||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryRequest"
|
||||
PromptAnswerRequest:
|
||||
description: An array of PromptAnswer objects
|
||||
name: promptAnswerRequest
|
||||
required: true
|
||||
in: body
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerRequest"
|
||||
PromptTagRequest:
|
||||
description: An array of PromptTag objects
|
||||
name: promptTagRequest
|
||||
|
@ -533,6 +540,10 @@ responses:
|
|||
description: Response with PromptCategory objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptCategoryResponse"
|
||||
PromptAnswerResponse:
|
||||
description: Response with PromptAnswer objects
|
||||
schema:
|
||||
$ref: "#/definitions/PromptAnswerResponse"
|
||||
PromptTagResponse:
|
||||
description: Response with PromptTag objects
|
||||
schema:
|
||||
|
@ -1882,6 +1893,78 @@ paths:
|
|||
summary: Add a new Observation
|
||||
tags:
|
||||
- Observations
|
||||
/promptanswers:
|
||||
get:
|
||||
description: Return a list of PromptAnswers records from the datastore
|
||||
operationId: getPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Get a list of PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
post:
|
||||
description: Create PromptAnswers
|
||||
operationId: postPromptAnswers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Create new PromptResponses
|
||||
tags:
|
||||
- Prompts
|
||||
put:
|
||||
description: Update PromptAnswers
|
||||
operationId: putPromptAnsweers
|
||||
parameters:
|
||||
- $ref: "#/parameters/PromptAnswerRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/PromptAnswerResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Update PromptResponse
|
||||
tags:
|
||||
- Prompts
|
||||
/prompts:
|
||||
get:
|
||||
description: Return a list of Prompt records from the datastore
|
||||
|
@ -4510,6 +4593,22 @@ definitions:
|
|||
format: int64
|
||||
type: number
|
||||
type: object
|
||||
PromptAnswerRequest:
|
||||
description: An array of Prompt objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
PromptAnswerResponse:
|
||||
description: An array of PromptResponse objects
|
||||
properties:
|
||||
Data:
|
||||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
type: object
|
||||
RequestMeta:
|
||||
properties:
|
||||
ExternalAccount:
|
||||
|
|
Loading…
Reference in New Issue