lib/api/members/members_client/prompts/prompts_client.go

954 lines
34 KiB
Go
Raw Permalink Normal View History

2023-06-04 23:54:48 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package prompts
import (
"context"
2023-06-04 23:54:48 +00:00
"fmt"
"time"
2023-06-04 23:54:48 +00:00
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
2023-06-04 23:54:48 +00:00
"github.com/go-openapi/strfmt"
)
// New creates a new prompts API client.
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
2023-06-04 23:54:48 +00:00
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.
2023-06-04 23:54:48 +00:00
type Client struct {
transport runtime.ContextualTransport
2023-06-04 23:54:48 +00:00
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
2023-06-04 23:54:48 +00:00
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods.
2023-06-04 23:54:48 +00:00
type ClientService interface {
// GetPromptAnswers get a list of prompt responses.
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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.
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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.
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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)
2023-06-04 23:54:48 +00:00
SetTransport(transport runtime.ContextualTransport)
}
2023-06-17 01:24:46 +00:00
// 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.
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
if params == nil {
params = NewGetPromptAnswersParams()
}
2023-06-17 01:24:46 +00:00
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,
}
2023-06-17 01:24:46 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-17 01:24:46 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewGetPromptCategoriesParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
if params == nil {
params = NewGetPromptTagsParams()
}
2023-06-05 19:44:18 +00:00
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,
}
2023-06-05 19:44:18 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-05 19:44:18 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewGetPromptsParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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.
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
if params == nil {
params = NewPostPromptAnswersParams()
}
2023-06-17 01:24:46 +00:00
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,
}
2023-06-17 01:24:46 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-17 01:24:46 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewPostPromptCategoriesParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
if params == nil {
params = NewPostPromptTagsParams()
}
2023-06-05 19:44:18 +00:00
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,
}
2023-06-05 19:44:18 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-05 19:44:18 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewPostPromptsParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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.
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
if params == nil {
params = NewPutPromptAnsweersParams()
}
2023-06-17 01:24:46 +00:00
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,
}
2023-06-17 01:24:46 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-17 01:24:46 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-17 01:24:46 +00:00
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
2023-06-17 01:24:46 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewPutPromptCategoriesParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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.
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
if params == nil {
params = NewPutPromptTagsParams()
}
2023-06-05 19:44:18 +00:00
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,
}
2023-06-05 19:44:18 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-05 19:44:18 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-05 19:44:18 +00:00
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
2023-06-05 19:44:18 +00:00
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.
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
if params == nil {
params = NewPutPromptsParams()
}
2023-06-04 23:54:48 +00:00
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,
}
2023-06-04 23:54:48 +00:00
for _, opt := range opts {
opt(op)
}
result, err := a.transport.SubmitContext(ctx, op)
2023-06-04 23:54:48 +00:00
if err != nil {
return nil, err
}
// only one success response has to be checked
2023-06-04 23:54:48 +00:00
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
2023-06-04 23:54:48 +00:00
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) {
2023-06-04 23:54:48 +00:00
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
}