mirror of https://github.com/vernonkeenan/lib
954 lines
34 KiB
Go
954 lines
34 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package prompts
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
httptransport "github.com/go-openapi/runtime/client"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// New creates a new prompts API client.
|
|
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
// New creates a new prompts API client with basic auth credentials.
|
|
//
|
|
// It takes the following parameters:
|
|
// - host: http host (github.com).
|
|
// - basePath: any base path for the API client ("/v1", "/v3").
|
|
// - scheme: http scheme ("http", "https").
|
|
// - user: user for basic authentication header.
|
|
// - password: password for basic authentication header.
|
|
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
|
transport := httptransport.New(host, basePath, []string{scheme})
|
|
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
|
return &Client{transport: transport, formats: strfmt.Default}
|
|
}
|
|
|
|
// New creates a new prompts API client with a bearer token for authentication.
|
|
//
|
|
// It takes the following parameters:
|
|
// - host: http host (github.com).
|
|
// - basePath: any base path for the API client ("/v1", "/v3").
|
|
// - scheme: http scheme ("http", "https").
|
|
// - bearerToken: bearer token for Bearer authentication header.
|
|
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
|
transport := httptransport.New(host, basePath, []string{scheme})
|
|
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
|
return &Client{transport: transport, formats: strfmt.Default}
|
|
}
|
|
|
|
// Client for prompts API.
|
|
type Client struct {
|
|
transport runtime.ContextualTransport
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ClientOption may be used to customize the behavior of Client methods.
|
|
type ClientOption func(*runtime.ClientOperation)
|
|
|
|
// ClientService is the interface for Client methods.
|
|
type ClientService interface {
|
|
|
|
// GetPromptAnswers get a list of prompt responses.
|
|
GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error)
|
|
|
|
// GetPromptAnswersContext get a list of prompt responses.
|
|
GetPromptAnswersContext(ctx context.Context, params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error)
|
|
|
|
// GetPromptCategories get a list of prompt categories.
|
|
GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error)
|
|
|
|
// GetPromptCategoriesContext get a list of prompt categories.
|
|
GetPromptCategoriesContext(ctx context.Context, params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error)
|
|
|
|
// GetPromptTags get a list of prompt tags.
|
|
GetPromptTags(params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error)
|
|
|
|
// GetPromptTagsContext get a list of prompt tags.
|
|
GetPromptTagsContext(ctx context.Context, params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error)
|
|
|
|
// GetPrompts get a list of prompts.
|
|
GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error)
|
|
|
|
// GetPromptsContext get a list of prompts.
|
|
GetPromptsContext(ctx context.Context, params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error)
|
|
|
|
// PostPromptAnswers create new prompt responses.
|
|
PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error)
|
|
|
|
// PostPromptAnswersContext create new prompt responses.
|
|
PostPromptAnswersContext(ctx context.Context, params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error)
|
|
|
|
// PostPromptCategories create new prompt categories.
|
|
PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error)
|
|
|
|
// PostPromptCategoriesContext create new prompt categories.
|
|
PostPromptCategoriesContext(ctx context.Context, params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error)
|
|
|
|
// PostPromptTags create new prompt tags.
|
|
PostPromptTags(params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error)
|
|
|
|
// PostPromptTagsContext create new prompt tags.
|
|
PostPromptTagsContext(ctx context.Context, params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error)
|
|
|
|
// PostPrompts create new prompts.
|
|
PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
|
|
|
|
// PostPromptsContext create new prompts.
|
|
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(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
|
|
|
// PutPromptCategoriesContext update prompt categories.
|
|
PutPromptCategoriesContext(ctx context.Context, params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
|
|
|
|
// PutPromptTags update prompt tags.
|
|
PutPromptTags(params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error)
|
|
|
|
// PutPromptTagsContext update prompt tags.
|
|
PutPromptTagsContext(ctx context.Context, params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error)
|
|
|
|
// PutPrompts update prompts.
|
|
PutPrompts(params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error)
|
|
|
|
// PutPromptsContext update prompts.
|
|
PutPromptsContext(ctx context.Context, params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error)
|
|
|
|
SetTransport(transport runtime.ContextualTransport)
|
|
}
|
|
|
|
// GetPromptAnswers gets a list of prompt responses.
|
|
//
|
|
// Return a list of PromptAnswers records from the datastore.
|
|
//
|
|
// 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.GetPromptAnswersContext] instead.
|
|
func (a *Client) GetPromptAnswers(params *GetPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptAnswersOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.GetPromptAnswersContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// GetPromptAnswersContext gets a list of prompt responses.
|
|
//
|
|
// Return a list of PromptAnswers records from the datastore.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated 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,
|
|
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.(*GetPromptAnswersOK)
|
|
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 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.
|
|
//
|
|
// Return a list of PromptCategory records from the datastore.
|
|
//
|
|
// 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.GetPromptCategoriesContext] instead.
|
|
func (a *Client) GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.GetPromptCategoriesContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// GetPromptCategoriesContext gets a list of prompt categories.
|
|
//
|
|
// Return a list of PromptCategory records from the datastore.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewGetPromptCategoriesParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "getPromptCategories",
|
|
Method: "GET",
|
|
PathPattern: "/promptcategories",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &GetPromptCategoriesReader{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.(*GetPromptCategoriesOK)
|
|
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 getPromptCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// GetPromptTags gets a list of prompt tags.
|
|
//
|
|
// Return a list of PromptTag records from the datastore.
|
|
//
|
|
// 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.GetPromptTagsContext] instead.
|
|
func (a *Client) GetPromptTags(params *GetPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptTagsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.GetPromptTagsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// GetPromptTagsContext gets a list of prompt tags.
|
|
//
|
|
// Return a list of PromptTag records from the datastore.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewGetPromptTagsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "getPromptTags",
|
|
Method: "GET",
|
|
PathPattern: "/prompttags",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &GetPromptTagsReader{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.(*GetPromptTagsOK)
|
|
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 getPromptTags: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// GetPrompts gets a list of prompts.
|
|
//
|
|
// Return a list of Prompt records from the datastore.
|
|
//
|
|
// 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.GetPromptsContext] instead.
|
|
func (a *Client) GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.GetPromptsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// GetPromptsContext gets a list of prompts.
|
|
//
|
|
// Return a list of Prompt records from the datastore.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewGetPromptsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "getPrompts",
|
|
Method: "GET",
|
|
PathPattern: "/prompts",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &GetPromptsReader{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.(*GetPromptsOK)
|
|
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 getPrompts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PostPromptAnswers creates new prompt responses.
|
|
//
|
|
// Create 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.PostPromptAnswersContext] instead.
|
|
func (a *Client) PostPromptAnswers(params *PostPromptAnswersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptAnswersOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PostPromptAnswersContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PostPromptAnswersContext creates new prompt responses.
|
|
//
|
|
// Create PromptAnswers.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated 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,
|
|
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.(*PostPromptAnswersOK)
|
|
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 postPromptAnswers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PostPromptCategories creates new prompt categories.
|
|
//
|
|
// Create PromptCategories.
|
|
//
|
|
// 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.PostPromptCategoriesContext] instead.
|
|
func (a *Client) PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PostPromptCategoriesContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PostPromptCategoriesContext creates new prompt categories.
|
|
//
|
|
// Create PromptCategories.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPostPromptCategoriesParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "postPromptCategories",
|
|
Method: "POST",
|
|
PathPattern: "/promptcategories",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PostPromptCategoriesReader{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.(*PostPromptCategoriesOK)
|
|
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 postPromptCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PostPromptTags creates new prompt tags.
|
|
//
|
|
// Create PromptTags in Taxnexus.
|
|
//
|
|
// 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.PostPromptTagsContext] instead.
|
|
func (a *Client) PostPromptTags(params *PostPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptTagsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PostPromptTagsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PostPromptTagsContext creates new prompt tags.
|
|
//
|
|
// Create PromptTags in Taxnexus.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPostPromptTagsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "postPromptTags",
|
|
Method: "POST",
|
|
PathPattern: "/prompttags",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PostPromptTagsReader{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.(*PostPromptTagsOK)
|
|
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 postPromptTags: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PostPrompts creates new prompts.
|
|
//
|
|
// Create Prompts.
|
|
//
|
|
// 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.PostPromptsContext] instead.
|
|
func (a *Client) PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PostPromptsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PostPromptsContext creates new prompts.
|
|
//
|
|
// Create Prompts.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPostPromptsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "postPrompts",
|
|
Method: "POST",
|
|
PathPattern: "/prompts",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PostPromptsReader{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.(*PostPromptsOK)
|
|
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 postPrompts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
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.
|
|
//
|
|
// Update PromptCategory.
|
|
//
|
|
// 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.PutPromptCategoriesContext] instead.
|
|
func (a *Client) PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PutPromptCategoriesContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PutPromptCategoriesContext updates prompt categories.
|
|
//
|
|
// Update PromptCategory.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPutPromptCategoriesParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "putPromptCategories",
|
|
Method: "PUT",
|
|
PathPattern: "/promptcategories",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PutPromptCategoriesReader{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.(*PutPromptCategoriesOK)
|
|
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 putPromptCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PutPromptTags updates prompt tags.
|
|
//
|
|
// Update PromptTag in Taxnexus.
|
|
//
|
|
// 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.PutPromptTagsContext] instead.
|
|
func (a *Client) PutPromptTags(params *PutPromptTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptTagsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PutPromptTagsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PutPromptTagsContext updates prompt tags.
|
|
//
|
|
// Update PromptTag in Taxnexus.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPutPromptTagsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "putPromptTags",
|
|
Method: "PUT",
|
|
PathPattern: "/prompttags",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PutPromptTagsReader{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.(*PutPromptTagsOK)
|
|
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 putPromptTags: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// PutPrompts updates prompts.
|
|
//
|
|
// Update Prompt.
|
|
//
|
|
// 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.PutPromptsContext] instead.
|
|
func (a *Client) PutPrompts(params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error) {
|
|
var ctx context.Context
|
|
if params.inner.ctx != nil {
|
|
ctx = params.inner.ctx
|
|
} else {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
return a.PutPromptsContext(ctx, params, authInfo, opts...)
|
|
}
|
|
|
|
// PutPromptsContext updates prompts.
|
|
//
|
|
// Update Prompt.
|
|
//
|
|
// 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) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPutPromptsParams()
|
|
}
|
|
|
|
op := &runtime.ClientOperation{
|
|
ID: "putPrompts",
|
|
Method: "PUT",
|
|
PathPattern: "/prompts",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PutPromptsReader{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.(*PutPromptsOK)
|
|
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 putPrompts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// SetTransport changes the transport on the client
|
|
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
|
a.transport = transport
|
|
}
|
|
|
|
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
|
type innerParams struct {
|
|
timeout time.Duration
|
|
|
|
// Deprecated: use the operation call with context to pass the context instead of [PromptsParams].
|
|
ctx context.Context
|
|
}
|