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

302 lines
9.9 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
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new prompts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for prompts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error)
GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error)
PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error)
PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error)
PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error)
PutPrompts(params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetPromptCategories gets a list of prompt categories
Return a list of PromptCategory records from the datastore
*/
func (a *Client) GetPromptCategories(params *GetPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptCategoriesOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetPromptCategoriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getPromptCategories: 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
*/
func (a *Client) GetPrompts(params *GetPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPromptsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetPromptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getPrompts: 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
*/
func (a *Client) PostPromptCategories(params *PostPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptCategoriesOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostPromptCategoriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postPromptCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostPrompts creates new prompts
Create Prompts
*/
func (a *Client) PostPrompts(params *PostPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPromptsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostPromptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postPrompts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutPromptCategories updates prompt categories
Update PromptCategory
*/
func (a *Client) PutPromptCategories(params *PutPromptCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptCategoriesOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutPromptCategoriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putPromptCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutPrompts updates prompts
Update Prompt
*/
func (a *Client) PutPrompts(params *PutPromptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPromptsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutPromptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for 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.ClientTransport) {
a.transport = transport
}