mirror of https://github.com/vernonkeenan/lib
parent
8ced08e0b0
commit
cef842bb34
|
|
@ -0,0 +1,442 @@
|
||||||
|
package members_client_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"regexp"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/prompts"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
openapiruntime "github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
const membersPromptProviderSpecSHA256 = "ea2c06f8551555ecf3d36e4d728ba34beeae8731370a64535e194686b16ad07f"
|
||||||
|
|
||||||
|
var promptTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
type promptCaptureTransport struct {
|
||||||
|
operation *openapiruntime.ClientOperation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *promptCaptureTransport) Submit(operation *openapiruntime.ClientOperation) (any, error) {
|
||||||
|
return transport.SubmitContext(context.Background(), operation)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *promptCaptureTransport) SubmitContext(_ context.Context, operation *openapiruntime.ClientOperation) (any, error) {
|
||||||
|
transport.operation = operation
|
||||||
|
|
||||||
|
switch operation.ID {
|
||||||
|
case "getPrompts":
|
||||||
|
return prompts.NewGetPromptsOK(), nil
|
||||||
|
case "postPrompts":
|
||||||
|
return prompts.NewPostPromptsOK(), nil
|
||||||
|
case "putPrompts":
|
||||||
|
return prompts.NewPutPromptsOK(), nil
|
||||||
|
case "getPromptAnswers":
|
||||||
|
return prompts.NewGetPromptAnswersOK(), nil
|
||||||
|
case "postPromptAnswers":
|
||||||
|
return prompts.NewPostPromptAnswersOK(), nil
|
||||||
|
case "getPromptCategories":
|
||||||
|
return prompts.NewGetPromptCategoriesOK(), nil
|
||||||
|
case "postPromptCategories":
|
||||||
|
return prompts.NewPostPromptCategoriesOK(), nil
|
||||||
|
case "putPromptCategories":
|
||||||
|
return prompts.NewPutPromptCategoriesOK(), nil
|
||||||
|
case "getPromptTags":
|
||||||
|
return prompts.NewGetPromptTagsOK(), nil
|
||||||
|
case "postPromptTags":
|
||||||
|
return prompts.NewPostPromptTagsOK(), nil
|
||||||
|
case "putPromptTags":
|
||||||
|
return prompts.NewPutPromptTagsOK(), nil
|
||||||
|
default:
|
||||||
|
panic("unexpected generated prompt operation: " + operation.ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedPromptOperationContract(t *testing.T) {
|
||||||
|
type operationCall func(openapiruntime.ContextualTransport) error
|
||||||
|
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
wantID string
|
||||||
|
wantMethod string
|
||||||
|
wantPath string
|
||||||
|
call operationCall
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "list prompts", wantID: "getPrompts", wantMethod: "GET", wantPath: "/prompts",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).GetPrompts(prompts.NewGetPromptsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "create prompt", wantID: "postPrompts", wantMethod: "POST", wantPath: "/prompts",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PostPrompts(prompts.NewPostPromptsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "update prompt", wantID: "putPrompts", wantMethod: "PUT", wantPath: "/prompts",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PutPrompts(prompts.NewPutPromptsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "list prompt answers", wantID: "getPromptAnswers", wantMethod: "GET", wantPath: "/promptanswers",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).GetPromptAnswers(prompts.NewGetPromptAnswersParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "append prompt answer", wantID: "postPromptAnswers", wantMethod: "POST", wantPath: "/promptanswers",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PostPromptAnswers(prompts.NewPostPromptAnswersParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "list prompt categories", wantID: "getPromptCategories", wantMethod: "GET", wantPath: "/promptcategories",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).GetPromptCategories(prompts.NewGetPromptCategoriesParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "create prompt category", wantID: "postPromptCategories", wantMethod: "POST", wantPath: "/promptcategories",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PostPromptCategories(prompts.NewPostPromptCategoriesParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "update prompt category", wantID: "putPromptCategories", wantMethod: "PUT", wantPath: "/promptcategories",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PutPromptCategories(prompts.NewPutPromptCategoriesParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "list prompt tags", wantID: "getPromptTags", wantMethod: "GET", wantPath: "/prompttags",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).GetPromptTags(prompts.NewGetPromptTagsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "create prompt tag", wantID: "postPromptTags", wantMethod: "POST", wantPath: "/prompttags",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PostPromptTags(prompts.NewPostPromptTagsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "update prompt tag", wantID: "putPromptTags", wantMethod: "PUT", wantPath: "/prompttags",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := prompts.New(transport, strfmt.Default).PutPromptTags(prompts.NewPutPromptTagsParams(), promptTestAuth)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
transport := &promptCaptureTransport{}
|
||||||
|
if err := test.call(transport); err != nil {
|
||||||
|
t.Fatalf("generated client operation failed: %v", err)
|
||||||
|
}
|
||||||
|
if transport.operation == nil {
|
||||||
|
t.Fatal("generated client did not submit an operation")
|
||||||
|
}
|
||||||
|
if transport.operation.ID != test.wantID {
|
||||||
|
t.Errorf("operation ID = %q, want %q", transport.operation.ID, test.wantID)
|
||||||
|
}
|
||||||
|
if transport.operation.Method != test.wantMethod {
|
||||||
|
t.Errorf("method = %q, want %q", transport.operation.Method, test.wantMethod)
|
||||||
|
}
|
||||||
|
if transport.operation.PathPattern != test.wantPath {
|
||||||
|
t.Errorf("path = %q, want %q", transport.operation.PathPattern, test.wantPath)
|
||||||
|
}
|
||||||
|
if transport.operation.AuthInfo == nil {
|
||||||
|
t.Error("generated operation discarded its auth-info writer")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPromptSpecRequiresExactCompoundAuthentication(t *testing.T) {
|
||||||
|
specText := readMembersPromptSpec(t)
|
||||||
|
for _, definition := range []string{
|
||||||
|
" ApiKeyAuth:\n type: \"apiKey\"\n in: \"header\"\n name: \"X-API-Key\"",
|
||||||
|
" kvSessionCookie:\n name: Cookie\n in: header\n type: apiKey",
|
||||||
|
} {
|
||||||
|
if !strings.Contains(specText, definition) {
|
||||||
|
t.Fatalf("authoritative spec is missing exact authentication definition:\n%s", definition)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
operations := map[string]map[string]string{
|
||||||
|
"/prompts": {
|
||||||
|
"GET": "getPrompts",
|
||||||
|
"POST": "postPrompts",
|
||||||
|
"PUT": "putPrompts",
|
||||||
|
},
|
||||||
|
"/promptanswers": {
|
||||||
|
"GET": "getPromptAnswers",
|
||||||
|
"POST": "postPromptAnswers",
|
||||||
|
},
|
||||||
|
"/promptcategories": {
|
||||||
|
"GET": "getPromptCategories",
|
||||||
|
"POST": "postPromptCategories",
|
||||||
|
"PUT": "putPromptCategories",
|
||||||
|
},
|
||||||
|
"/prompttags": {
|
||||||
|
"GET": "getPromptTags",
|
||||||
|
"POST": "postPromptTags",
|
||||||
|
"PUT": "putPromptTags",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for path, methods := range operations {
|
||||||
|
for method, operationID := range methods {
|
||||||
|
operation := promptSpecOperationBlock(t, specText, path, strings.ToLower(method))
|
||||||
|
if !strings.Contains(operation, " operationId: "+operationID+"\n") {
|
||||||
|
t.Errorf("%s %s does not preserve operationId %q", method, path, operationID)
|
||||||
|
}
|
||||||
|
const compoundSecurity = " security:\n - ApiKeyAuth: []\n kvSessionCookie: []"
|
||||||
|
if strings.Count(operation, compoundSecurity) != 1 {
|
||||||
|
t.Errorf("%s %s does not require the exact API-key + human-session compound security", method, path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPromptModelHasExactFullFieldParity(t *testing.T) {
|
||||||
|
want := map[string]string{
|
||||||
|
"CreatedByID": "*string",
|
||||||
|
"CreatedDate": "*string",
|
||||||
|
"ID": "string",
|
||||||
|
"Icon": "*string",
|
||||||
|
"ImageAltText": "*string",
|
||||||
|
"ImageURL": "*string",
|
||||||
|
"LastModifiedByID": "*string",
|
||||||
|
"LastModifiedDate": "*string",
|
||||||
|
"Logo": "*string",
|
||||||
|
"MaxTokens": "*float64",
|
||||||
|
"Model": "*string",
|
||||||
|
"Name": "*string",
|
||||||
|
"Order": "*float64",
|
||||||
|
"Parameters": "*string",
|
||||||
|
"Prompt": "*string",
|
||||||
|
"PromptCategoryID": "*string",
|
||||||
|
"ResearchProjectIDs": "[]string",
|
||||||
|
"Slug": "*string",
|
||||||
|
"System": "*string",
|
||||||
|
"Tags": "[]string",
|
||||||
|
"Temperature": "*float64",
|
||||||
|
"TenantID": "*string",
|
||||||
|
"Title": "*string",
|
||||||
|
"UsedCount": "*float64",
|
||||||
|
"UserID": "*string",
|
||||||
|
}
|
||||||
|
|
||||||
|
model := reflect.TypeOf(members_models.Prompt{})
|
||||||
|
if model.NumField() != len(want) {
|
||||||
|
t.Fatalf("Prompt has %d fields, want exact authoritative set of %d", model.NumField(), len(want))
|
||||||
|
}
|
||||||
|
for name, wantType := range want {
|
||||||
|
field, exists := model.FieldByName(name)
|
||||||
|
if !exists {
|
||||||
|
t.Errorf("Prompt is missing authoritative field %s", name)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if field.Type.String() != wantType {
|
||||||
|
t.Errorf("Prompt.%s type = %s, want %s", name, field.Type, wantType)
|
||||||
|
}
|
||||||
|
if got := strings.Split(field.Tag.Get("json"), ",")[0]; got != name {
|
||||||
|
t.Errorf("Prompt.%s JSON name = %q, want %q", name, got, name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maxTokens := 4096.0
|
||||||
|
body, err := json.Marshal(members_models.Prompt{MaxTokens: &maxTokens})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("marshal Prompt: %v", err)
|
||||||
|
}
|
||||||
|
if !bytes.Contains(body, []byte(`"MaxTokens":4096`)) {
|
||||||
|
t.Fatalf("Prompt JSON lost MaxTokens: %s", body)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPromptAnswerIsAppendOnlyAndLegacyMisspellingIsAbsent(t *testing.T) {
|
||||||
|
contract := reflect.TypeOf((*prompts.ClientService)(nil)).Elem()
|
||||||
|
for _, method := range []string{
|
||||||
|
"PutPromptAnswer",
|
||||||
|
"PutPromptAnswerContext",
|
||||||
|
"PutPromptAnswers",
|
||||||
|
"PutPromptAnswersContext",
|
||||||
|
"PutPromptAnsweer",
|
||||||
|
"PutPromptAnsweerContext",
|
||||||
|
"PutPromptAnsweers",
|
||||||
|
"PutPromptAnsweersContext",
|
||||||
|
} {
|
||||||
|
if _, exists := contract.MethodByName(method); exists {
|
||||||
|
t.Errorf("append-only PromptAnswer client exposes forbidden update %s", method)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
answerPath := promptSpecPathBlock(t, readMembersPromptSpec(t), "/promptanswers")
|
||||||
|
for _, forbidden := range []string{" put:", " patch:", " delete:"} {
|
||||||
|
if strings.Contains(answerPath, forbidden) {
|
||||||
|
t.Fatalf("authoritative PromptAnswer contract exposes forbidden operation %q", strings.TrimSpace(forbidden))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPromptUpdateClientsPreserveConflictResponses(t *testing.T) {
|
||||||
|
conflicts := []interface{ IsCode(int) bool }{
|
||||||
|
prompts.NewPutPromptsConflict(),
|
||||||
|
prompts.NewPutPromptCategoriesConflict(),
|
||||||
|
prompts.NewPutPromptTagsConflict(),
|
||||||
|
}
|
||||||
|
for _, conflict := range conflicts {
|
||||||
|
if !conflict.IsCode(409) {
|
||||||
|
t.Errorf("%T does not preserve the optimistic-conflict response", conflict)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMembersSpecIsPinnedToPromptProviderSource(t *testing.T) {
|
||||||
|
repoRoot := promptRepoRoot(t)
|
||||||
|
mainSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "members-vernonkeenan.yaml"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("read Members spec: %v", err)
|
||||||
|
}
|
||||||
|
sum := sha256.Sum256(mainSpec)
|
||||||
|
if got := hex.EncodeToString(sum[:]); got != membersPromptProviderSpecSHA256 {
|
||||||
|
t.Fatalf("Members spec drifted from provider commit 4e868f1: SHA-256 = %s, want %s", got, membersPromptProviderSpecSHA256)
|
||||||
|
}
|
||||||
|
|
||||||
|
externalSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "external", "members-vernonkeenan.yaml"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("read external Members spec: %v", err)
|
||||||
|
}
|
||||||
|
normalized := bytes.ReplaceAll(externalSpec, []byte(`"https"`), []byte(`"http"`))
|
||||||
|
normalized = bytes.ReplaceAll(normalized, []byte("gw.tnxs.net"), []byte("members.vernonkeenan.com:8080"))
|
||||||
|
normalized = bytes.ReplaceAll(normalized, []byte(`"/vk/members/v1"`), []byte(`"/v1"`))
|
||||||
|
if !bytes.Equal(normalized, mainSpec) {
|
||||||
|
t.Fatal("external Members spec differs from the conventional host/scheme/base-path rewrite")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedPromptSurfaceHasNoSalesforceOrEmbeddedSecrets(t *testing.T) {
|
||||||
|
repoRoot := promptRepoRoot(t)
|
||||||
|
targets := []string{
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_client", "prompts"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_request.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_response.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_answer.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_answer_request.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_answer_response.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_category.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_category_request.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_category_response.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_tag.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_tag_request.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "prompt_tag_response.go"),
|
||||||
|
}
|
||||||
|
credentialLiteral := regexp.MustCompile(`(?i)(api[_-]?key|password|secret)\s*[:=]\s*["'][^"']+["']`)
|
||||||
|
|
||||||
|
for _, target := range targets {
|
||||||
|
err := filepath.WalkDir(target, func(path string, entry os.DirEntry, walkErr error) error {
|
||||||
|
if walkErr != nil {
|
||||||
|
return walkErr
|
||||||
|
}
|
||||||
|
if entry.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
content, err := os.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
lower := strings.ToLower(string(content))
|
||||||
|
for _, forbidden := range []string{"salesforce", "sf-gate", "go-force", "private key-----"} {
|
||||||
|
if strings.Contains(lower, forbidden) {
|
||||||
|
t.Errorf("%s contains forbidden boundary %q", path, forbidden)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if credentialLiteral.Match(content) {
|
||||||
|
t.Errorf("%s contains a credential-shaped literal", path)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("scan generated prompt target %s: %v", target, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func readMembersPromptSpec(t *testing.T) string {
|
||||||
|
t.Helper()
|
||||||
|
content, err := os.ReadFile(filepath.Join(promptRepoRoot(t), "swagger", "members-vernonkeenan.yaml"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("read Members Swagger: %v", err)
|
||||||
|
}
|
||||||
|
return string(content)
|
||||||
|
}
|
||||||
|
|
||||||
|
func promptSpecPathBlock(t *testing.T, specText, path string) string {
|
||||||
|
t.Helper()
|
||||||
|
startMarker := " " + path + ":\n"
|
||||||
|
start := strings.Index(specText, startMarker)
|
||||||
|
if start < 0 {
|
||||||
|
t.Fatalf("authoritative spec is missing path %s", path)
|
||||||
|
}
|
||||||
|
block := specText[start+len(startMarker):]
|
||||||
|
if end := strings.Index(block, "\n /"); end >= 0 {
|
||||||
|
block = block[:end]
|
||||||
|
}
|
||||||
|
return block
|
||||||
|
}
|
||||||
|
|
||||||
|
func promptSpecOperationBlock(t *testing.T, specText, path, method string) string {
|
||||||
|
t.Helper()
|
||||||
|
pathBlock := promptSpecPathBlock(t, specText, path)
|
||||||
|
startMarker := " " + method + ":\n"
|
||||||
|
start := strings.Index(pathBlock, startMarker)
|
||||||
|
if start < 0 {
|
||||||
|
t.Fatalf("authoritative spec is missing %s %s", strings.ToUpper(method), path)
|
||||||
|
}
|
||||||
|
block := pathBlock[start+len(startMarker):]
|
||||||
|
methodBoundary := regexp.MustCompile(`(?m)^ [a-z]+:\n`)
|
||||||
|
if end := methodBoundary.FindStringIndex(block); end != nil {
|
||||||
|
block = block[:end[0]]
|
||||||
|
}
|
||||||
|
return block
|
||||||
|
}
|
||||||
|
|
||||||
|
func promptRepoRoot(t *testing.T) string {
|
||||||
|
t.Helper()
|
||||||
|
_, testFile, _, ok := runtime.Caller(0)
|
||||||
|
if !ok {
|
||||||
|
t.Fatal("resolve test source path")
|
||||||
|
}
|
||||||
|
return filepath.Clean(filepath.Join(filepath.Dir(testFile), "..", "..", ".."))
|
||||||
|
}
|
||||||
|
|
@ -108,12 +108,6 @@ type ClientService interface {
|
||||||
// PostPromptsContext create new prompts.
|
// PostPromptsContext create new prompts.
|
||||||
PostPromptsContext(ctx context.Context, params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
|
PostPromptsContext(ctx context.Context, params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
|
||||||
|
|
||||||
// PutPromptAnsweers update prompt response.
|
|
||||||
PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error)
|
|
||||||
|
|
||||||
// PutPromptAnsweersContext update prompt response.
|
|
||||||
PutPromptAnsweersContext(ctx context.Context, params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error)
|
|
||||||
|
|
||||||
// PutPromptCategories update prompt categories.
|
// PutPromptCategories update prompt categories.
|
||||||
PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
||||||
|
|
||||||
|
|
@ -137,7 +131,7 @@ type ClientService interface {
|
||||||
|
|
||||||
// GetPromptAnswers gets a list of prompt responses.
|
// GetPromptAnswers gets a list of prompt responses.
|
||||||
//
|
//
|
||||||
// Return a list of PromptAnswers records from the datastore.
|
// Tenant/owner-scoped prompt execution-result read. Requires members:prompt-answer:read and an active human session..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -156,7 +150,7 @@ func (a *Client) GetPromptAnswers(params *GetPromptAnswersParams, authInfo runti
|
||||||
|
|
||||||
// GetPromptAnswersContext gets a list of prompt responses.
|
// GetPromptAnswersContext gets a list of prompt responses.
|
||||||
//
|
//
|
||||||
// Return a list of PromptAnswers records from the datastore.
|
// Tenant/owner-scoped prompt execution-result read. Requires members:prompt-answer:read and an active human session..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [GetPromptAnswersParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [GetPromptAnswersParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) GetPromptAnswersContext(ctx context.Context, params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error) {
|
func (a *Client) GetPromptAnswersContext(ctx context.Context, params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error) {
|
||||||
|
|
@ -204,7 +198,7 @@ func (a *Client) GetPromptAnswersContext(ctx context.Context, params *GetPromptA
|
||||||
|
|
||||||
// GetPromptCategories gets a list of prompt categories.
|
// GetPromptCategories gets a list of prompt categories.
|
||||||
//
|
//
|
||||||
// Return a list of PromptCategory records from the datastore.
|
// Global prompt taxonomy read for active Keenan Vision members. Requires members:prompt-category:read..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -223,7 +217,7 @@ func (a *Client) GetPromptCategories(params *GetPromptCategoriesParams, authInfo
|
||||||
|
|
||||||
// GetPromptCategoriesContext gets a list of prompt categories.
|
// GetPromptCategoriesContext gets a list of prompt categories.
|
||||||
//
|
//
|
||||||
// Return a list of PromptCategory records from the datastore.
|
// Global prompt taxonomy read for active Keenan Vision members. Requires members:prompt-category:read..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [GetPromptCategoriesParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [GetPromptCategoriesParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) GetPromptCategoriesContext(ctx context.Context, params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error) {
|
func (a *Client) GetPromptCategoriesContext(ctx context.Context, params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error) {
|
||||||
|
|
@ -271,7 +265,7 @@ func (a *Client) GetPromptCategoriesContext(ctx context.Context, params *GetProm
|
||||||
|
|
||||||
// GetPromptTags gets a list of prompt tags.
|
// GetPromptTags gets a list of prompt tags.
|
||||||
//
|
//
|
||||||
// Return a list of PromptTag records from the datastore.
|
// Global prompt taxonomy read for active Keenan Vision members. Requires members:prompt-tag:read..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -290,7 +284,7 @@ func (a *Client) GetPromptTags(params *GetPromptTagsParams, authInfo runtime.Cli
|
||||||
|
|
||||||
// GetPromptTagsContext gets a list of prompt tags.
|
// GetPromptTagsContext gets a list of prompt tags.
|
||||||
//
|
//
|
||||||
// Return a list of PromptTag records from the datastore.
|
// Global prompt taxonomy read for active Keenan Vision members. Requires members:prompt-tag:read..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [GetPromptTagsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [GetPromptTagsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) GetPromptTagsContext(ctx context.Context, params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error) {
|
func (a *Client) GetPromptTagsContext(ctx context.Context, params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error) {
|
||||||
|
|
@ -338,7 +332,7 @@ func (a *Client) GetPromptTagsContext(ctx context.Context, params *GetPromptTags
|
||||||
|
|
||||||
// GetPrompts gets a list of prompts.
|
// GetPrompts gets a list of prompts.
|
||||||
//
|
//
|
||||||
// Return a list of Prompt records from the datastore.
|
// Tenant/owner-scoped prompt read. Requires members:prompt:read and an active human session..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -357,7 +351,7 @@ func (a *Client) GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAut
|
||||||
|
|
||||||
// GetPromptsContext gets a list of prompts.
|
// GetPromptsContext gets a list of prompts.
|
||||||
//
|
//
|
||||||
// Return a list of Prompt records from the datastore.
|
// Tenant/owner-scoped prompt read. Requires members:prompt:read and an active human session..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [GetPromptsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [GetPromptsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) GetPromptsContext(ctx context.Context, params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error) {
|
func (a *Client) GetPromptsContext(ctx context.Context, params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error) {
|
||||||
|
|
@ -405,7 +399,7 @@ func (a *Client) GetPromptsContext(ctx context.Context, params *GetPromptsParams
|
||||||
|
|
||||||
// PostPromptAnswers creates new prompt responses.
|
// PostPromptAnswers creates new prompt responses.
|
||||||
//
|
//
|
||||||
// Create PromptAnswers.
|
// Append an immutable prompt execution result. Requires members:prompt-answer:create. IDs, audit, tenant, and user are governed by Members..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -424,7 +418,7 @@ func (a *Client) PostPromptAnswers(params *PostPromptAnswersParams, authInfo run
|
||||||
|
|
||||||
// PostPromptAnswersContext creates new prompt responses.
|
// PostPromptAnswersContext creates new prompt responses.
|
||||||
//
|
//
|
||||||
// Create PromptAnswers.
|
// Append an immutable prompt execution result. Requires members:prompt-answer:create. IDs, audit, tenant, and user are governed by Members..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PostPromptAnswersParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PostPromptAnswersParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PostPromptAnswersContext(ctx context.Context, params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error) {
|
func (a *Client) PostPromptAnswersContext(ctx context.Context, params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error) {
|
||||||
|
|
@ -472,7 +466,7 @@ func (a *Client) PostPromptAnswersContext(ctx context.Context, params *PostPromp
|
||||||
|
|
||||||
// PostPromptCategories creates new prompt categories.
|
// PostPromptCategories creates new prompt categories.
|
||||||
//
|
//
|
||||||
// Create PromptCategories.
|
// Global prompt taxonomy create for an active Keenan Vision Owner or Manager. Requires members:prompt-category:create..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -491,7 +485,7 @@ func (a *Client) PostPromptCategories(params *PostPromptCategoriesParams, authIn
|
||||||
|
|
||||||
// PostPromptCategoriesContext creates new prompt categories.
|
// PostPromptCategoriesContext creates new prompt categories.
|
||||||
//
|
//
|
||||||
// Create PromptCategories.
|
// Global prompt taxonomy create for an active Keenan Vision Owner or Manager. Requires members:prompt-category:create..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PostPromptCategoriesParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PostPromptCategoriesParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PostPromptCategoriesContext(ctx context.Context, params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error) {
|
func (a *Client) PostPromptCategoriesContext(ctx context.Context, params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error) {
|
||||||
|
|
@ -539,7 +533,7 @@ func (a *Client) PostPromptCategoriesContext(ctx context.Context, params *PostPr
|
||||||
|
|
||||||
// PostPromptTags creates new prompt tags.
|
// PostPromptTags creates new prompt tags.
|
||||||
//
|
//
|
||||||
// Create PromptTags in Taxnexus.
|
// Global prompt taxonomy create for an active Keenan Vision Owner or Manager. Requires members:prompt-tag:create..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -558,7 +552,7 @@ func (a *Client) PostPromptTags(params *PostPromptTagsParams, authInfo runtime.C
|
||||||
|
|
||||||
// PostPromptTagsContext creates new prompt tags.
|
// PostPromptTagsContext creates new prompt tags.
|
||||||
//
|
//
|
||||||
// Create PromptTags in Taxnexus.
|
// Global prompt taxonomy create for an active Keenan Vision Owner or Manager. Requires members:prompt-tag:create..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PostPromptTagsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PostPromptTagsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PostPromptTagsContext(ctx context.Context, params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error) {
|
func (a *Client) PostPromptTagsContext(ctx context.Context, params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error) {
|
||||||
|
|
@ -606,7 +600,7 @@ func (a *Client) PostPromptTagsContext(ctx context.Context, params *PostPromptTa
|
||||||
|
|
||||||
// PostPrompts creates new prompts.
|
// PostPrompts creates new prompts.
|
||||||
//
|
//
|
||||||
// Create Prompts.
|
// Tenant/owner-scoped prompt create. Requires members:prompt:create. IDs, audit, tenant, user, and usage are governed by Members..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -625,7 +619,7 @@ func (a *Client) PostPrompts(params *PostPromptsParams, authInfo runtime.ClientA
|
||||||
|
|
||||||
// PostPromptsContext creates new prompts.
|
// PostPromptsContext creates new prompts.
|
||||||
//
|
//
|
||||||
// Create Prompts.
|
// Tenant/owner-scoped prompt create. Requires members:prompt:create. IDs, audit, tenant, user, and usage are governed by Members..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PostPromptsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PostPromptsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PostPromptsContext(ctx context.Context, params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error) {
|
func (a *Client) PostPromptsContext(ctx context.Context, params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error) {
|
||||||
|
|
@ -671,76 +665,9 @@ func (a *Client) PostPromptsContext(ctx context.Context, params *PostPromptsPara
|
||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutPromptAnsweers updates prompt response.
|
|
||||||
//
|
|
||||||
// Update PromptAnswers.
|
|
||||||
//
|
|
||||||
// This method does not support injected context.
|
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
|
||||||
//
|
|
||||||
// If you need to pass a specific context, use [Client.PutPromptAnsweersContext] instead.
|
|
||||||
func (a *Client) PutPromptAnsweers(params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error) {
|
|
||||||
var ctx context.Context
|
|
||||||
if params.inner.ctx != nil {
|
|
||||||
ctx = params.inner.ctx
|
|
||||||
} else {
|
|
||||||
ctx = context.Background()
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.PutPromptAnsweersContext(ctx, params, authInfo, opts...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutPromptAnsweersContext updates prompt response.
|
|
||||||
//
|
|
||||||
// Update PromptAnswers.
|
|
||||||
//
|
|
||||||
// Do not use the deprecated [PutPromptAnsweersParams.Context] with this method: it would be ignored.
|
|
||||||
func (a *Client) PutPromptAnsweersContext(ctx context.Context, params *PutPromptAnsweersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptAnsweersOK, error) {
|
|
||||||
// NOTE: parameters are not validated 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,
|
|
||||||
Client: params.HTTPClient,
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(op)
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := a.transport.SubmitContext(ctx, op)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// only one success response has to be checked
|
|
||||||
success, ok := result.(*PutPromptAnsweersOK)
|
|
||||||
if ok {
|
|
||||||
return success, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// unexpected success response.
|
|
||||||
|
|
||||||
// no default response is defined.
|
|
||||||
//
|
|
||||||
// safeguard: normally, in the absence of 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.
|
// PutPromptCategories updates prompt categories.
|
||||||
//
|
//
|
||||||
// Update PromptCategory.
|
// Global prompt taxonomy update for an active Keenan Vision Owner or Manager. Requires members:prompt-category:update and LastModifiedDate CAS..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -759,7 +686,7 @@ func (a *Client) PutPromptCategories(params *PutPromptCategoriesParams, authInfo
|
||||||
|
|
||||||
// PutPromptCategoriesContext updates prompt categories.
|
// PutPromptCategoriesContext updates prompt categories.
|
||||||
//
|
//
|
||||||
// Update PromptCategory.
|
// Global prompt taxonomy update for an active Keenan Vision Owner or Manager. Requires members:prompt-category:update and LastModifiedDate CAS..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PutPromptCategoriesParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PutPromptCategoriesParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PutPromptCategoriesContext(ctx context.Context, params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error) {
|
func (a *Client) PutPromptCategoriesContext(ctx context.Context, params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error) {
|
||||||
|
|
@ -807,7 +734,7 @@ func (a *Client) PutPromptCategoriesContext(ctx context.Context, params *PutProm
|
||||||
|
|
||||||
// PutPromptTags updates prompt tags.
|
// PutPromptTags updates prompt tags.
|
||||||
//
|
//
|
||||||
// Update PromptTag in Taxnexus.
|
// Global prompt taxonomy update for an active Keenan Vision Owner or Manager. Requires members:prompt-tag:update and LastModifiedDate CAS..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -826,7 +753,7 @@ func (a *Client) PutPromptTags(params *PutPromptTagsParams, authInfo runtime.Cli
|
||||||
|
|
||||||
// PutPromptTagsContext updates prompt tags.
|
// PutPromptTagsContext updates prompt tags.
|
||||||
//
|
//
|
||||||
// Update PromptTag in Taxnexus.
|
// Global prompt taxonomy update for an active Keenan Vision Owner or Manager. Requires members:prompt-tag:update and LastModifiedDate CAS..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PutPromptTagsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PutPromptTagsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PutPromptTagsContext(ctx context.Context, params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error) {
|
func (a *Client) PutPromptTagsContext(ctx context.Context, params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error) {
|
||||||
|
|
@ -874,7 +801,7 @@ func (a *Client) PutPromptTagsContext(ctx context.Context, params *PutPromptTags
|
||||||
|
|
||||||
// PutPrompts updates prompts.
|
// PutPrompts updates prompts.
|
||||||
//
|
//
|
||||||
// Update Prompt.
|
// Tenant/owner-scoped full prompt replacement. Requires members:prompt:update and LastModifiedDate CAS. IDs, audit, tenant, user, and usage are governed by Members..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -893,7 +820,7 @@ func (a *Client) PutPrompts(params *PutPromptsParams, authInfo runtime.ClientAut
|
||||||
|
|
||||||
// PutPromptsContext updates prompts.
|
// PutPromptsContext updates prompts.
|
||||||
//
|
//
|
||||||
// Update Prompt.
|
// Tenant/owner-scoped full prompt replacement. Requires members:prompt:update and LastModifiedDate CAS. IDs, audit, tenant, user, and usage are governed by Members..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [PutPromptsParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [PutPromptsParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) PutPromptsContext(ctx context.Context, params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error) {
|
func (a *Client) PutPromptsContext(ctx context.Context, params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error) {
|
||||||
|
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package prompts
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/errors"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
cr "github.com/go-openapi/runtime/client"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 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 NewPutPromptAnsweersParamsWithTimeout(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{
|
|
||||||
inner: innerParams{
|
|
||||||
timeout: timeout,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutPromptAnsweersParamsWithContext creates a new PutPromptAnsweersParams object
|
|
||||||
// with the ability to set a context for a request.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutPromptAnsweersParams].
|
|
||||||
func NewPutPromptAnsweersParamsWithContext(ctx context.Context) *PutPromptAnsweersParams {
|
|
||||||
return &PutPromptAnsweersParams{
|
|
||||||
inner: innerParams{
|
|
||||||
ctx: 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
|
|
||||||
|
|
||||||
HTTPClient *http.Client
|
|
||||||
|
|
||||||
inner innerParams
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.inner.timeout = timeout
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithContext adds the context to the put prompt answeers params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutPromptAnsweersParams].
|
|
||||||
func (o *PutPromptAnsweersParams) WithContext(ctx context.Context) *PutPromptAnsweersParams {
|
|
||||||
o.SetContext(ctx)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetContext adds the context to the put prompt answeers params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutPromptAnsweersParams].
|
|
||||||
func (o *PutPromptAnsweersParams) SetContext(ctx context.Context) {
|
|
||||||
o.inner.ctx = 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 [runtime.ClientRequest].
|
|
||||||
func (o *PutPromptAnsweersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
||||||
if err := r.SetTimeout(o.inner.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
|
|
||||||
}
|
|
||||||
|
|
@ -1,484 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package prompts
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
stderrors "errors"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 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) (any, 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("[PUT /promptanswers] putPromptAnsweers", 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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %s", 200, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersOK) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersOK %s", 200, 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 && !stderrors.Is(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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %s", 401, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersUnauthorized) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnauthorized %s", 401, 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 && !stderrors.Is(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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %s", 403, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersForbidden) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersForbidden %s", 403, 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 && !stderrors.Is(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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %s", 404, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersNotFound) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersNotFound %s", 404, 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 && !stderrors.Is(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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %s", 422, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersUnprocessableEntity) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersUnprocessableEntity %s", 422, 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 && !stderrors.Is(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 {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %s", 500, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutPromptAnsweersInternalServerError) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /promptanswers][%d] putPromptAnsweersInternalServerError %s", 500, 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 && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -49,6 +49,12 @@ func (o *PutPromptCategoriesReader) ReadResponse(response runtime.ClientResponse
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
|
case 409:
|
||||||
|
result := NewPutPromptCategoriesConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
case 422:
|
case 422:
|
||||||
result := NewPutPromptCategoriesUnprocessableEntity()
|
result := NewPutPromptCategoriesUnprocessableEntity()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
|
@ -347,6 +353,74 @@ func (o *PutPromptCategoriesNotFound) readResponse(response runtime.ClientRespon
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewPutPromptCategoriesConflict creates a PutPromptCategoriesConflict with default headers values
|
||||||
|
func NewPutPromptCategoriesConflict() *PutPromptCategoriesConflict {
|
||||||
|
return &PutPromptCategoriesConflict{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutPromptCategoriesConflict describes a response with status code 409, with default header values.
|
||||||
|
//
|
||||||
|
// The supplied LastModifiedDate is stale; reload the record before retrying.
|
||||||
|
type PutPromptCategoriesConflict struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put prompt categories conflict response has a 2xx status code
|
||||||
|
func (o *PutPromptCategoriesConflict) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put prompt categories conflict response has a 3xx status code
|
||||||
|
func (o *PutPromptCategoriesConflict) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put prompt categories conflict response has a 4xx status code
|
||||||
|
func (o *PutPromptCategoriesConflict) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put prompt categories conflict response has a 5xx status code
|
||||||
|
func (o *PutPromptCategoriesConflict) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put prompt categories conflict response a status code equal to that given
|
||||||
|
func (o *PutPromptCategoriesConflict) IsCode(code int) bool {
|
||||||
|
return code == 409
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put prompt categories conflict response
|
||||||
|
func (o *PutPromptCategoriesConflict) Code() int {
|
||||||
|
return 409
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptCategoriesConflict) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /promptcategories][%d] putPromptCategoriesConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptCategoriesConflict) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /promptcategories][%d] putPromptCategoriesConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptCategoriesConflict) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptCategoriesConflict) 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 && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// NewPutPromptCategoriesUnprocessableEntity creates a PutPromptCategoriesUnprocessableEntity with default headers values
|
// NewPutPromptCategoriesUnprocessableEntity creates a PutPromptCategoriesUnprocessableEntity with default headers values
|
||||||
func NewPutPromptCategoriesUnprocessableEntity() *PutPromptCategoriesUnprocessableEntity {
|
func NewPutPromptCategoriesUnprocessableEntity() *PutPromptCategoriesUnprocessableEntity {
|
||||||
return &PutPromptCategoriesUnprocessableEntity{}
|
return &PutPromptCategoriesUnprocessableEntity{}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ func (o *PutPromptTagsReader) ReadResponse(response runtime.ClientResponse, cons
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
|
case 409:
|
||||||
|
result := NewPutPromptTagsConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
case 422:
|
case 422:
|
||||||
result := NewPutPromptTagsUnprocessableEntity()
|
result := NewPutPromptTagsUnprocessableEntity()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
|
@ -347,6 +353,74 @@ func (o *PutPromptTagsNotFound) readResponse(response runtime.ClientResponse, co
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewPutPromptTagsConflict creates a PutPromptTagsConflict with default headers values
|
||||||
|
func NewPutPromptTagsConflict() *PutPromptTagsConflict {
|
||||||
|
return &PutPromptTagsConflict{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutPromptTagsConflict describes a response with status code 409, with default header values.
|
||||||
|
//
|
||||||
|
// The supplied LastModifiedDate is stale; reload the record before retrying.
|
||||||
|
type PutPromptTagsConflict struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put prompt tags conflict response has a 2xx status code
|
||||||
|
func (o *PutPromptTagsConflict) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put prompt tags conflict response has a 3xx status code
|
||||||
|
func (o *PutPromptTagsConflict) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put prompt tags conflict response has a 4xx status code
|
||||||
|
func (o *PutPromptTagsConflict) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put prompt tags conflict response has a 5xx status code
|
||||||
|
func (o *PutPromptTagsConflict) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put prompt tags conflict response a status code equal to that given
|
||||||
|
func (o *PutPromptTagsConflict) IsCode(code int) bool {
|
||||||
|
return code == 409
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put prompt tags conflict response
|
||||||
|
func (o *PutPromptTagsConflict) Code() int {
|
||||||
|
return 409
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptTagsConflict) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /prompttags][%d] putPromptTagsConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptTagsConflict) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /prompttags][%d] putPromptTagsConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptTagsConflict) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptTagsConflict) 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 && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// NewPutPromptTagsUnprocessableEntity creates a PutPromptTagsUnprocessableEntity with default headers values
|
// NewPutPromptTagsUnprocessableEntity creates a PutPromptTagsUnprocessableEntity with default headers values
|
||||||
func NewPutPromptTagsUnprocessableEntity() *PutPromptTagsUnprocessableEntity {
|
func NewPutPromptTagsUnprocessableEntity() *PutPromptTagsUnprocessableEntity {
|
||||||
return &PutPromptTagsUnprocessableEntity{}
|
return &PutPromptTagsUnprocessableEntity{}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ func (o *PutPromptsReader) ReadResponse(response runtime.ClientResponse, consume
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
|
case 409:
|
||||||
|
result := NewPutPromptsConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
case 422:
|
case 422:
|
||||||
result := NewPutPromptsUnprocessableEntity()
|
result := NewPutPromptsUnprocessableEntity()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
|
@ -347,6 +353,74 @@ func (o *PutPromptsNotFound) readResponse(response runtime.ClientResponse, consu
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewPutPromptsConflict creates a PutPromptsConflict with default headers values
|
||||||
|
func NewPutPromptsConflict() *PutPromptsConflict {
|
||||||
|
return &PutPromptsConflict{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutPromptsConflict describes a response with status code 409, with default header values.
|
||||||
|
//
|
||||||
|
// The supplied LastModifiedDate is stale; reload the record before retrying.
|
||||||
|
type PutPromptsConflict struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put prompts conflict response has a 2xx status code
|
||||||
|
func (o *PutPromptsConflict) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put prompts conflict response has a 3xx status code
|
||||||
|
func (o *PutPromptsConflict) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put prompts conflict response has a 4xx status code
|
||||||
|
func (o *PutPromptsConflict) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put prompts conflict response has a 5xx status code
|
||||||
|
func (o *PutPromptsConflict) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put prompts conflict response a status code equal to that given
|
||||||
|
func (o *PutPromptsConflict) IsCode(code int) bool {
|
||||||
|
return code == 409
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put prompts conflict response
|
||||||
|
func (o *PutPromptsConflict) Code() int {
|
||||||
|
return 409
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptsConflict) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /prompts][%d] putPromptsConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptsConflict) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /prompts][%d] putPromptsConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptsConflict) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutPromptsConflict) 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 && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// NewPutPromptsUnprocessableEntity creates a PutPromptsUnprocessableEntity with default headers values
|
// NewPutPromptsUnprocessableEntity creates a PutPromptsUnprocessableEntity with default headers values
|
||||||
func NewPutPromptsUnprocessableEntity() *PutPromptsUnprocessableEntity {
|
func NewPutPromptsUnprocessableEntity() *PutPromptsUnprocessableEntity {
|
||||||
return &PutPromptsUnprocessableEntity{}
|
return &PutPromptsUnprocessableEntity{}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue