repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a batch of custom vocabulary items for a given bot locale's custom
// vocabulary.
func (c *Client) BatchDeleteCustomVocabularyItem(ctx context.Context, params *BatchDeleteCustomVocabularyItemInput, optFns ...func(*Options)) (*BatchDeleteCustomVocabularyItemOutput, error) {
if params == nil {
params = &BatchDeleteCustomVocabularyItemInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchDeleteCustomVocabularyItem", params, optFns, c.addOperationBatchDeleteCustomVocabularyItemMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchDeleteCustomVocabularyItemOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchDeleteCustomVocabularyItemInput struct {
// The identifier of the bot associated with this custom vocabulary.
//
// This member is required.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
//
// This member is required.
BotVersion *string
// A list of custom vocabulary items requested to be deleted. Each entry must
// contain the unique custom vocabulary entry identifier.
//
// This member is required.
CustomVocabularyItemList []types.CustomVocabularyEntryId
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type BatchDeleteCustomVocabularyItemOutput struct {
// The identifier of the bot associated with this custom vocabulary.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
BotVersion *string
// A list of custom vocabulary items that failed to delete during the operation.
// The reason for the error is contained within each error object.
Errors []types.FailedCustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported languages
// (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html).
LocaleId *string
// A list of custom vocabulary items that were successfully deleted during the
// operation.
Resources []types.CustomVocabularyItem
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchDeleteCustomVocabularyItemMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteCustomVocabularyItem{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteCustomVocabularyItem{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchDeleteCustomVocabularyItemValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteCustomVocabularyItem(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opBatchDeleteCustomVocabularyItem(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "BatchDeleteCustomVocabularyItem",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Update a batch of custom vocabulary items for a given bot locale's custom
// vocabulary.
func (c *Client) BatchUpdateCustomVocabularyItem(ctx context.Context, params *BatchUpdateCustomVocabularyItemInput, optFns ...func(*Options)) (*BatchUpdateCustomVocabularyItemOutput, error) {
if params == nil {
params = &BatchUpdateCustomVocabularyItemInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchUpdateCustomVocabularyItem", params, optFns, c.addOperationBatchUpdateCustomVocabularyItemMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchUpdateCustomVocabularyItemOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchUpdateCustomVocabularyItemInput struct {
// The identifier of the bot associated with this custom vocabulary
//
// This member is required.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
//
// This member is required.
BotVersion *string
// A list of custom vocabulary items with updated fields. Each entry must contain
// a phrase and can optionally contain a displayAs and/or a weight.
//
// This member is required.
CustomVocabularyItemList []types.CustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type BatchUpdateCustomVocabularyItemOutput struct {
// The identifier of the bot associated with this custom vocabulary.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
BotVersion *string
// A list of custom vocabulary items that failed to update during the operation.
// The reason for the error is contained within each error object.
Errors []types.FailedCustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
LocaleId *string
// A list of custom vocabulary items that were successfully updated during the
// operation.
Resources []types.CustomVocabularyItem
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchUpdateCustomVocabularyItemMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateCustomVocabularyItem{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateCustomVocabularyItem{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchUpdateCustomVocabularyItemValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateCustomVocabularyItem(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opBatchUpdateCustomVocabularyItem(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "BatchUpdateCustomVocabularyItem",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Builds a bot, its intents, and its slot types into a specific locale. A bot can
// be built into multiple locales. At runtime the locale is used to choose a
// specific build of the bot.
func (c *Client) BuildBotLocale(ctx context.Context, params *BuildBotLocaleInput, optFns ...func(*Options)) (*BuildBotLocaleOutput, error) {
if params == nil {
params = &BuildBotLocaleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BuildBotLocale", params, optFns, c.addOperationBuildBotLocaleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BuildBotLocaleOutput)
out.ResultMetadata = metadata
return out, nil
}
type BuildBotLocaleInput struct {
// The identifier of the bot to build. The identifier is returned in the response
// from the CreateBot (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html)
// operation.
//
// This member is required.
BotId *string
// The version of the bot to build. This can only be the draft version of the bot.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that the bot will be used in. The
// string must match one of the supported locales. All of the intents, slot types,
// and slots used in the bot must have the same locale. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type BuildBotLocaleOutput struct {
// The identifier of the specified bot.
BotId *string
// The bot's build status. When the status is ReadyExpressTesting you can test the
// bot using the utterances defined for the intents and slot types. When the status
// is Built , the bot is ready for use and can be tested using any utterance.
BotLocaleStatus types.BotLocaleStatus
// The version of the bot that was built. This is only the draft version of the
// bot.
BotVersion *string
// A timestamp indicating the date and time that the bot was last built for this
// locale.
LastBuildSubmittedDateTime *time.Time
// The language and locale specified of where the bot can be used.
LocaleId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBuildBotLocaleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBuildBotLocale{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBuildBotLocale{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBuildBotLocaleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBuildBotLocale(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opBuildBotLocale(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "BuildBotLocale",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an Amazon Lex conversational bot.
func (c *Client) CreateBot(ctx context.Context, params *CreateBotInput, optFns ...func(*Options)) (*CreateBotOutput, error) {
if params == nil {
params = &CreateBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateBot", params, optFns, c.addOperationCreateBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateBotInput struct {
// The name of the bot. The bot name must be unique in the account that creates
// the bot.
//
// This member is required.
BotName *string
// Provides information on additional privacy protections Amazon Lex should use
// with the bot's data.
//
// This member is required.
DataPrivacy *types.DataPrivacy
// The time, in seconds, that Amazon Lex should keep information about a user's
// conversation with the bot. A user interaction remains active for the amount of
// time specified. If no conversation occurs during this time, the session expires
// and Amazon Lex deletes any data provided before the timeout. You can specify
// between 60 (1 minute) and 86,400 (24 hours) seconds.
//
// This member is required.
IdleSessionTTLInSeconds *int32
// The Amazon Resource Name (ARN) of an IAM role that has permission to access the
// bot.
//
// This member is required.
RoleArn *string
// The list of bot members in a network to be created.
BotMembers []types.BotMember
// A list of tags to add to the bot. You can only add tags when you create a bot.
// You can't use the UpdateBot operation to update tags. To update tags, use the
// TagResource operation.
BotTags map[string]string
// The type of a bot to create.
BotType types.BotType
// A description of the bot. It appears in lists to help you identify a particular
// bot.
Description *string
// A list of tags to add to the test alias for a bot. You can only add tags when
// you create a bot. You can't use the UpdateAlias operation to update tags. To
// update tags on the test alias, use the TagResource operation.
TestBotAliasTags map[string]string
noSmithyDocumentSerde
}
type CreateBotOutput struct {
// A unique identifier for a particular bot. You use this to identify the bot when
// you call other Amazon Lex API operations.
BotId *string
// The list of bots in a network that was created.
BotMembers []types.BotMember
// The name specified for the bot.
BotName *string
// Shows the current status of the bot. The bot is first in the Creating status.
// Once the bot is read for use, it changes to the Available status. After the bot
// is created, you can use the DRAFT version of the bot.
BotStatus types.BotStatus
// A list of tags associated with the bot.
BotTags map[string]string
// The type of a bot that was created.
BotType types.BotType
// A timestamp indicating the date and time that the bot was created.
CreationDateTime *time.Time
// The data privacy settings specified for the bot.
DataPrivacy *types.DataPrivacy
// The description specified for the bot.
Description *string
// The session idle time specified for the bot.
IdleSessionTTLInSeconds *int32
// The IAM role specified for the bot.
RoleArn *string
// A list of tags associated with the test alias for the bot.
TestBotAliasTags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateBot",
}
}
| 204 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an alias for the specified version of a bot. Use an alias to enable you
// to change the version of a bot without updating applications that use the bot.
// For example, you can create an alias called "PROD" that your applications use to
// call the Amazon Lex bot.
func (c *Client) CreateBotAlias(ctx context.Context, params *CreateBotAliasInput, optFns ...func(*Options)) (*CreateBotAliasOutput, error) {
if params == nil {
params = &CreateBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateBotAlias", params, optFns, c.addOperationCreateBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateBotAliasInput struct {
// The alias to create. The name must be unique for the bot.
//
// This member is required.
BotAliasName *string
// The unique identifier of the bot that the alias applies to.
//
// This member is required.
BotId *string
// Maps configuration information to a specific locale. You can use this parameter
// to specify a specific Lambda function to run different functions in different
// locales.
BotAliasLocaleSettings map[string]types.BotAliasLocaleSettings
// The version of the bot that this alias points to. You can use the UpdateBotAlias (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_UpdateBotAlias.html)
// operation to change the bot version associated with the alias.
BotVersion *string
// Specifies whether Amazon Lex logs text and audio for a conversation with the
// bot. When you enable conversation logs, text logs store text input, transcripts
// of audio input, and associated metadata in Amazon CloudWatch Logs. Audio logs
// store audio input in Amazon S3.
ConversationLogSettings *types.ConversationLogSettings
// A description of the alias. Use this description to help identify the alias.
Description *string
// Determines whether Amazon Lex will use Amazon Comprehend to detect the
// sentiment of user utterances.
SentimentAnalysisSettings *types.SentimentAnalysisSettings
// A list of tags to add to the bot alias. You can only add tags when you create
// an alias, you can't use the UpdateBotAlias operation to update the tags on a
// bot alias. To update tags, use the TagResource operation.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateBotAliasOutput struct {
// The unique identifier of the bot alias.
BotAliasId *string
// Configuration information for a specific locale.
BotAliasLocaleSettings map[string]types.BotAliasLocaleSettings
// The name specified for the bot alias.
BotAliasName *string
// The current status of the alias. The alias is first put into the Creating
// state. When the alias is ready to be used, it is put into the Available state.
// You can use the DescribeBotAlias operation to get the current state of an alias.
BotAliasStatus types.BotAliasStatus
// The unique identifier of the bot that this alias applies to.
BotId *string
// The version of the bot associated with this alias.
BotVersion *string
// The conversation log settings specified for the alias.
ConversationLogSettings *types.ConversationLogSettings
// A Unix timestamp indicating the date and time that the bot alias was created.
CreationDateTime *time.Time
// The description specified for the bot alias.
Description *string
// Determines whether Amazon Lex will use Amazon Comprehend to detect the
// sentiment of user utterances.
SentimentAnalysisSettings *types.SentimentAnalysisSettings
// A list of tags associated with the bot alias.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBotAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBotAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateBotAlias",
}
}
| 194 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a locale in the bot. The locale contains the intents and slot types
// that the bot uses in conversations with users in the specified language and
// locale. You must add a locale to a bot before you can add intents and slot types
// to the bot.
func (c *Client) CreateBotLocale(ctx context.Context, params *CreateBotLocaleInput, optFns ...func(*Options)) (*CreateBotLocaleOutput, error) {
if params == nil {
params = &CreateBotLocaleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateBotLocale", params, optFns, c.addOperationCreateBotLocaleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateBotLocaleOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateBotLocaleInput struct {
// The identifier of the bot to create the locale for.
//
// This member is required.
BotId *string
// The version of the bot to create the locale for. This can only be the draft
// version of the bot.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that the bot will be used in. The
// string must match one of the supported locales. All of the intents, slot types,
// and slots used in the bot must have the same locale. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// Determines the threshold where Amazon Lex will insert the AMAZON.FallbackIntent
// , AMAZON.KendraSearchIntent , or both when returning alternative intents.
// AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they
// are configured for the bot. For example, suppose a bot is configured with the
// confidence threshold of 0.80 and the AMAZON.FallbackIntent . Amazon Lex returns
// three alternative intents with the following confidence scores: IntentA (0.70),
// IntentB (0.60), IntentC (0.50). The response from the RecognizeText operation
// would be:
// - AMAZON.FallbackIntent
// - IntentA
// - IntentB
// - IntentC
//
// This member is required.
NluIntentConfidenceThreshold *float64
// A description of the bot locale. Use this to help identify the bot locale in
// lists.
Description *string
// The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the
// user.
VoiceSettings *types.VoiceSettings
noSmithyDocumentSerde
}
type CreateBotLocaleOutput struct {
// The specified bot identifier.
BotId *string
// The status of the bot. When the status is Creating the bot locale is being
// configured. When the status is Building Amazon Lex is building the bot for
// testing and use. If the status of the bot is ReadyExpressTesting , you can test
// the bot using the exact utterances specified in the bots' intents. When the bot
// is ready for full testing or to run, the status is Built . If there was a
// problem with building the bot, the status is Failed . If the bot was saved but
// not built, the status is NotBuilt .
BotLocaleStatus types.BotLocaleStatus
// The specified bot version.
BotVersion *string
// A timestamp specifying the date and time that the bot locale was created.
CreationDateTime *time.Time
// The specified description of the bot locale.
Description *string
// The specified locale identifier.
LocaleId *string
// The specified locale name.
LocaleName *string
// The specified confidence threshold for inserting the AMAZON.FallbackIntent and
// AMAZON.KendraSearchIntent intents.
NluIntentConfidenceThreshold *float64
// The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the
// user.
VoiceSettings *types.VoiceSettings
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateBotLocaleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBotLocale{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBotLocale{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateBotLocaleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBotLocale(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateBotLocale(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateBotLocale",
}
}
| 200 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new version of the bot based on the DRAFT version. If the DRAFT
// version of this resource hasn't changed since you created the last version,
// Amazon Lex doesn't create a new version, it returns the last created version.
// When you create the first version of a bot, Amazon Lex sets the version to 1.
// Subsequent versions increment by 1.
func (c *Client) CreateBotVersion(ctx context.Context, params *CreateBotVersionInput, optFns ...func(*Options)) (*CreateBotVersionOutput, error) {
if params == nil {
params = &CreateBotVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateBotVersion", params, optFns, c.addOperationCreateBotVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateBotVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateBotVersionInput struct {
// The identifier of the bot to create the version for.
//
// This member is required.
BotId *string
// Specifies the locales that Amazon Lex adds to this version. You can choose the
// Draft version or any other previously published version for each locale. When
// you specify a source version, the locale data is copied from the source version
// to the new version.
//
// This member is required.
BotVersionLocaleSpecification map[string]types.BotVersionLocaleDetails
// A description of the version. Use the description to help identify the version
// in lists.
Description *string
noSmithyDocumentSerde
}
type CreateBotVersionOutput struct {
// The bot identifier specified in the request.
BotId *string
// When you send a request to create or update a bot, Amazon Lex sets the status
// response element to Creating . After Amazon Lex builds the bot, it sets status
// to Available . If Amazon Lex can't build the bot, it sets status to Failed .
BotStatus types.BotStatus
// The version number assigned to the version.
BotVersion *string
// The source versions used for each locale in the new version.
BotVersionLocaleSpecification map[string]types.BotVersionLocaleDetails
// A timestamp of the date and time that the version was created.
CreationDateTime *time.Time
// The description of the version specified in the request.
Description *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateBotVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBotVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBotVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateBotVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBotVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateBotVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateBotVersion",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a zip archive containing the contents of a bot or a bot locale. The
// archive contains a directory structure that contains JSON files that define the
// bot. You can create an archive that contains the complete definition of a bot,
// or you can specify that the archive contain only the definition of a single bot
// locale. For more information about exporting bots, and about the structure of
// the export archive, see Importing and exporting bots (https://docs.aws.amazon.com/lexv2/latest/dg/importing-exporting.html)
func (c *Client) CreateExport(ctx context.Context, params *CreateExportInput, optFns ...func(*Options)) (*CreateExportOutput, error) {
if params == nil {
params = &CreateExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateExport", params, optFns, c.addOperationCreateExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateExportInput struct {
// The file format of the bot or bot locale definition files.
//
// This member is required.
FileFormat types.ImportExportFileFormat
// Specifies the type of resource to export, either a bot or a bot locale. You can
// only specify one type of resource to export.
//
// This member is required.
ResourceSpecification *types.ExportResourceSpecification
// An password to use to encrypt the exported archive. Using a password is
// optional, but you should encrypt the archive to protect the data in transit
// between Amazon Lex and your local computer.
FilePassword *string
noSmithyDocumentSerde
}
type CreateExportOutput struct {
// The date and time that the request to export a bot was created.
CreationDateTime *time.Time
// An identifier for a specific request to create an export.
ExportId *string
// The status of the export. When the status is Completed , you can use the
// DescribeExport (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html)
// operation to get the pre-signed S3 URL link to your exported bot or bot locale.
ExportStatus types.ExportStatus
// The file format used for the bot or bot locale definition files.
FileFormat types.ImportExportFileFormat
// A description of the type of resource that was exported, either a bot or a bot
// locale.
ResourceSpecification *types.ExportResourceSpecification
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateExport",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an intent. To define the interaction between the user and your bot, you
// define one or more intents. For example, for a pizza ordering bot you would
// create an OrderPizza intent. When you create an intent, you must provide a
// name. You can optionally provide the following:
// - Sample utterances. For example, "I want to order a pizza" and "Can I order
// a pizza." You can't provide utterances for built-in intents.
// - Information to be gathered. You specify slots for the information that you
// bot requests from the user. You can specify standard slot types, such as date
// and time, or custom slot types for your application.
// - How the intent is fulfilled. You can provide a Lambda function or configure
// the intent to return the intent information to your client application. If you
// use a Lambda function, Amazon Lex invokes the function when all of the intent
// information is available.
// - A confirmation prompt to send to the user to confirm an intent. For
// example, "Shall I order your pizza?"
// - A conclusion statement to send to the user after the intent is fulfilled.
// For example, "I ordered your pizza."
// - A follow-up prompt that asks the user for additional activity. For example,
// "Do you want a drink with your pizza?"
func (c *Client) CreateIntent(ctx context.Context, params *CreateIntentInput, optFns ...func(*Options)) (*CreateIntentOutput, error) {
if params == nil {
params = &CreateIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateIntent", params, optFns, c.addOperationCreateIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateIntentInput struct {
// The identifier of the bot associated with this intent.
//
// This member is required.
BotId *string
// The version of the bot associated with this intent.
//
// This member is required.
BotVersion *string
// The name of the intent. Intent names must be unique in the locale that contains
// the intent and cannot match the name of any built-in intent.
//
// This member is required.
IntentName *string
// The identifier of the language and locale where this intent is used. All of the
// bots, slot types, and slots used by the intent must have the same locale. For
// more information, see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// A description of the intent. Use the description to help identify the intent in
// lists.
Description *string
// Specifies that Amazon Lex invokes the alias Lambda function for each user
// input. You can invoke this Lambda function to personalize user interaction. For
// example, suppose that your bot determines that the user's name is John. You
// Lambda function might retrieve John's information from a backend database and
// prepopulate some of the values. For example, if you find that John is gluten
// intolerant, you might set the corresponding intent slot, glutenIntolerant to
// true . You might find John's phone number and set the corresponding session
// attribute.
DialogCodeHook *types.DialogCodeHookSettings
// Specifies that Amazon Lex invokes the alias Lambda function when the intent is
// ready for fulfillment. You can invoke this function to complete the bot's
// transaction with the user. For example, in a pizza ordering bot, the Lambda
// function can look up the closest pizza restaurant to the customer's location and
// then place an order on the customer's behalf.
FulfillmentCodeHook *types.FulfillmentCodeHookSettings
// Configuration settings for the response that is sent to the user at the
// beginning of a conversation, before eliciting slot values.
InitialResponseSetting *types.InitialResponseSetting
// A list of contexts that must be active for this intent to be considered by
// Amazon Lex. When an intent has an input context list, Amazon Lex only considers
// using the intent in an interaction with the user when the specified contexts are
// included in the active context list for the session. If the contexts are not
// active, then Amazon Lex will not use the intent. A context can be automatically
// activated using the outputContexts property or it can be set at runtime. For
// example, if there are two intents with different input contexts that respond to
// the same utterances, only the intent with the active context will respond. An
// intent may have up to 5 input contexts. If an intent has multiple input
// contexts, all of the contexts must be active to consider the intent.
InputContexts []types.InputContext
// Sets the response that Amazon Lex sends to the user when the intent is closed.
IntentClosingSetting *types.IntentClosingSetting
// Provides prompts that Amazon Lex sends to the user to confirm the completion of
// an intent. If the user answers "no," the settings contain a statement that is
// sent to the user to end the intent.
IntentConfirmationSetting *types.IntentConfirmationSetting
// Configuration information required to use the AMAZON.KendraSearchIntent intent
// to connect to an Amazon Kendra index. The AMAZON.KendraSearchIntent intent is
// called when Amazon Lex can't determine another intent to invoke.
KendraConfiguration *types.KendraConfiguration
// A lists of contexts that the intent activates when it is fulfilled. You can use
// an output context to indicate the intents that Amazon Lex should consider for
// the next turn of the conversation with a customer. When you use the
// outputContextsList property, all of the contexts specified in the list are
// activated when the intent is fulfilled. You can set up to 10 output contexts.
// You can also set the number of conversation turns that the context should be
// active, or the length of time that the context should be active.
OutputContexts []types.OutputContext
// A unique identifier for the built-in intent to base this intent on.
ParentIntentSignature *string
// An array of strings that a user might say to signal the intent. For example, "I
// want a pizza", or "I want a {PizzaSize} pizza". In an utterance, slot names are
// enclosed in curly braces ("{", "}") to indicate where they should be displayed
// in the utterance shown to the user..
SampleUtterances []types.SampleUtterance
noSmithyDocumentSerde
}
type CreateIntentOutput struct {
// The identifier of the bot associated with the intent.
BotId *string
// The version of the bot associated with the intent.
BotVersion *string
// A timestamp of the date and time that the intent was created.
CreationDateTime *time.Time
// The description specified for the intent.
Description *string
// The dialog Lambda function specified for the intent.
DialogCodeHook *types.DialogCodeHookSettings
// The fulfillment Lambda function specified for the intent.
FulfillmentCodeHook *types.FulfillmentCodeHookSettings
// Configuration settings for the response that is sent to the user at the
// beginning of a conversation, before eliciting slot values.
InitialResponseSetting *types.InitialResponseSetting
// The list of input contexts specified for the intent.
InputContexts []types.InputContext
// The closing setting specified for the intent.
IntentClosingSetting *types.IntentClosingSetting
// The confirmation setting specified for the intent.
IntentConfirmationSetting *types.IntentConfirmationSetting
// A unique identifier for the intent.
IntentId *string
// The name specified for the intent.
IntentName *string
// Configuration for searching a Amazon Kendra index specified for the intent.
KendraConfiguration *types.KendraConfiguration
// The locale that the intent is specified to use.
LocaleId *string
// The list of output contexts specified for the intent.
OutputContexts []types.OutputContext
// The signature of the parent intent specified for the intent.
ParentIntentSignature *string
// The sample utterances specified for the intent.
SampleUtterances []types.SampleUtterance
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateIntent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIntent(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateIntent",
}
}
| 280 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new resource policy with the specified policy statements.
func (c *Client) CreateResourcePolicy(ctx context.Context, params *CreateResourcePolicyInput, optFns ...func(*Options)) (*CreateResourcePolicyOutput, error) {
if params == nil {
params = &CreateResourcePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateResourcePolicy", params, optFns, c.addOperationCreateResourcePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateResourcePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateResourcePolicyInput struct {
// A resource policy to add to the resource. The policy is a JSON structure that
// contains one or more statements that define the policy. The policy must follow
// the IAM syntax. For more information about the contents of a JSON policy
// document, see IAM JSON policy reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)
// . If the policy isn't valid, Amazon Lex returns a validation exception.
//
// This member is required.
Policy *string
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type CreateResourcePolicyOutput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// was attached to.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateResourcePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateResourcePolicy",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a new resource policy statement to a bot or bot alias. If a resource
// policy exists, the statement is added to the current resource policy. If a
// policy doesn't exist, a new policy is created. You can't create a resource
// policy statement that allows cross-account access.
func (c *Client) CreateResourcePolicyStatement(ctx context.Context, params *CreateResourcePolicyStatementInput, optFns ...func(*Options)) (*CreateResourcePolicyStatementOutput, error) {
if params == nil {
params = &CreateResourcePolicyStatementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateResourcePolicyStatement", params, optFns, c.addOperationCreateResourcePolicyStatementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateResourcePolicyStatementOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateResourcePolicyStatementInput struct {
// The Amazon Lex action that this policy either allows or denies. The action must
// apply to the resource type of the specified ARN. For more information, see
// Actions, resources, and condition keys for Amazon Lex V2 (https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonlexv2.html)
// .
//
// This member is required.
Action []string
// Determines whether the statement allows or denies access to the resource.
//
// This member is required.
Effect types.Effect
// An IAM principal, such as an IAM user, IAM role, or Amazon Web Services
// services that is allowed or denied access to a resource. For more information,
// see Amazon Web Services JSON policy elements: Principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html)
// .
//
// This member is required.
Principal []types.Principal
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
//
// This member is required.
ResourceArn *string
// The name of the statement. The ID is the same as the Sid IAM property. The
// statement name must be unique within the policy. For more information, see IAM
// JSON policy elements: Sid (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html)
// .
//
// This member is required.
StatementId *string
// Specifies a condition when the policy is in effect. If the principal of the
// policy is a service principal, you must provide two condition blocks, one with a
// SourceAccount global condition key and one with a SourceArn global condition
// key. For more information, see IAM JSON policy elements: Condition (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html)
// .
Condition map[string]map[string]string
// The identifier of the revision of the policy to edit. If this revision ID
// doesn't match the current revision ID, Amazon Lex throws an exception. If you
// don't specify a revision, Amazon Lex overwrites the contents of the policy with
// the new values.
ExpectedRevisionId *string
noSmithyDocumentSerde
}
type CreateResourcePolicyStatementOutput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateResourcePolicyStatementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateResourcePolicyStatement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateResourcePolicyStatement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateResourcePolicyStatementValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourcePolicyStatement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateResourcePolicyStatement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateResourcePolicyStatement",
}
}
| 177 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a slot in an intent. A slot is a variable needed to fulfill an intent.
// For example, an OrderPizza intent might need slots for size, crust, and number
// of pizzas. For each slot, you define one or more utterances that Amazon Lex uses
// to elicit a response from the user.
func (c *Client) CreateSlot(ctx context.Context, params *CreateSlotInput, optFns ...func(*Options)) (*CreateSlotOutput, error) {
if params == nil {
params = &CreateSlotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSlot", params, optFns, c.addOperationCreateSlotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSlotOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSlotInput struct {
// The identifier of the bot associated with the slot.
//
// This member is required.
BotId *string
// The version of the bot associated with the slot.
//
// This member is required.
BotVersion *string
// The identifier of the intent that contains the slot.
//
// This member is required.
IntentId *string
// The identifier of the language and locale that the slot will be used in. The
// string must match one of the supported locales. All of the bots, intents, slot
// types used by the slot must have the same locale. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The name of the slot. Slot names must be unique within the bot that contains
// the slot.
//
// This member is required.
SlotName *string
// Specifies prompts that Amazon Lex sends to the user to elicit a response that
// provides the value for the slot.
//
// This member is required.
ValueElicitationSetting *types.SlotValueElicitationSetting
// A description of the slot. Use this to help identify the slot in lists.
Description *string
// Indicates whether the slot returns multiple values in one response. Multi-value
// slots are only available in the en-US locale. If you set this value to true in
// any other locale, Amazon Lex throws a ValidationException . If the
// multipleValuesSetting is not set, the default value is false .
MultipleValuesSetting *types.MultipleValuesSetting
// Determines how slot values are used in Amazon CloudWatch logs. If the value of
// the obfuscationSetting parameter is DefaultObfuscation , slot values are
// obfuscated in the log output. If the value is None , the actual value is present
// in the log output. The default is to obfuscate values in the CloudWatch logs.
ObfuscationSetting *types.ObfuscationSetting
// The unique identifier for the slot type associated with this slot. The slot
// type determines the values that can be entered into the slot.
SlotTypeId *string
// Specifications for the constituent sub slots and the expression for the
// composite slot.
SubSlotSetting *types.SubSlotSetting
noSmithyDocumentSerde
}
type CreateSlotOutput struct {
// The unique identifier of the bot associated with the slot.
BotId *string
// The version of the bot associated with the slot.
BotVersion *string
// The timestamp of the date and time that the slot was created.
CreationDateTime *time.Time
// The description associated with the slot.
Description *string
// The unique identifier of the intent associated with the slot.
IntentId *string
// The language and local specified for the slot.
LocaleId *string
// Indicates whether the slot returns multiple values in one response.
MultipleValuesSetting *types.MultipleValuesSetting
// Indicates whether the slot is configured to obfuscate values in Amazon
// CloudWatch logs.
ObfuscationSetting *types.ObfuscationSetting
// The unique identifier associated with the slot. Use this to identify the slot
// when you update or delete it.
SlotId *string
// The name specified for the slot.
SlotName *string
// The unique identifier of the slot type associated with this slot.
SlotTypeId *string
// Specifications for the constituent sub slots and the expression for the
// composite slot.
SubSlotSetting *types.SubSlotSetting
// The value elicitation settings specified for the slot.
ValueElicitationSetting *types.SlotValueElicitationSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSlotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSlot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSlot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSlotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSlot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSlot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateSlot",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a custom slot type To create a custom slot type, specify a name for the
// slot type and a set of enumeration values, the values that a slot of this type
// can assume.
func (c *Client) CreateSlotType(ctx context.Context, params *CreateSlotTypeInput, optFns ...func(*Options)) (*CreateSlotTypeOutput, error) {
if params == nil {
params = &CreateSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSlotType", params, optFns, c.addOperationCreateSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSlotTypeInput struct {
// The identifier of the bot associated with this slot type.
//
// This member is required.
BotId *string
// The identifier of the bot version associated with this slot type.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that the slot type will be used in.
// The string must match one of the supported locales. All of the bots, intents,
// and slots used by the slot type must have the same locale. For more information,
// see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The name for the slot. A slot type name must be unique within the intent.
//
// This member is required.
SlotTypeName *string
// Specifications for a composite slot type.
CompositeSlotTypeSetting *types.CompositeSlotTypeSetting
// A description of the slot type. Use the description to help identify the slot
// type in lists.
Description *string
// Sets the type of external information used to create the slot type.
ExternalSourceSetting *types.ExternalSourceSetting
// The built-in slot type used as a parent of this slot type. When you define a
// parent slot type, the new slot type has the configuration of the parent slot
// type. Only AMAZON.AlphaNumeric is supported.
ParentSlotTypeSignature *string
// A list of SlotTypeValue objects that defines the values that the slot type can
// take. Each value can have a list of synonyms, additional values that help train
// the machine learning model about the values that it resolves for a slot.
SlotTypeValues []types.SlotTypeValue
// Determines the strategy that Amazon Lex uses to select a value from the list of
// possible values. The field can be set to one of the following values:
// - ORIGINAL_VALUE - Returns the value entered by the user, if the user value is
// similar to the slot value.
// - TOP_RESOLUTION - If there is a resolution list for the slot, return the
// first value in the resolution list. If there is no resolution list, return null.
//
// If you don't specify the valueSelectionSetting parameter, the default is
// ORIGINAL_VALUE .
ValueSelectionSetting *types.SlotValueSelectionSetting
noSmithyDocumentSerde
}
type CreateSlotTypeOutput struct {
// The identifier for the bot associated with the slot type.
BotId *string
// The version of the bot associated with the slot type.
BotVersion *string
// Specifications for a composite slot type.
CompositeSlotTypeSetting *types.CompositeSlotTypeSetting
// A timestamp of the date and time that the slot type was created.
CreationDateTime *time.Time
// The description specified for the slot type.
Description *string
// The type of external information used to create the slot type.
ExternalSourceSetting *types.ExternalSourceSetting
// The specified language and local specified for the slot type.
LocaleId *string
// The signature of the base slot type specified for the slot type.
ParentSlotTypeSignature *string
// The unique identifier assigned to the slot type. Use this to identify the slot
// type in the UpdateSlotType and DeleteSlotType operations.
SlotTypeId *string
// The name specified for the slot type.
SlotTypeName *string
// The list of values that the slot type can assume.
SlotTypeValues []types.SlotTypeValue
// The strategy that Amazon Lex uses to select a value from the list of possible
// values.
ValueSelectionSetting *types.SlotValueSelectionSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSlotType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSlotType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateSlotType",
}
}
| 213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Create a report that describes the differences between the bot and the test set.
func (c *Client) CreateTestSetDiscrepancyReport(ctx context.Context, params *CreateTestSetDiscrepancyReportInput, optFns ...func(*Options)) (*CreateTestSetDiscrepancyReportOutput, error) {
if params == nil {
params = &CreateTestSetDiscrepancyReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTestSetDiscrepancyReport", params, optFns, c.addOperationCreateTestSetDiscrepancyReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTestSetDiscrepancyReportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateTestSetDiscrepancyReportInput struct {
// The target bot for the test set discrepancy report.
//
// This member is required.
Target *types.TestSetDiscrepancyReportResourceTarget
// The test set Id for the test set discrepancy report.
//
// This member is required.
TestSetId *string
noSmithyDocumentSerde
}
type CreateTestSetDiscrepancyReportOutput struct {
// The creation date and time for the test set discrepancy report.
CreationDateTime *time.Time
// The target bot for the test set discrepancy report.
Target *types.TestSetDiscrepancyReportResourceTarget
// The unique identifier of the test set discrepancy report to describe.
TestSetDiscrepancyReportId *string
// The test set Id for the test set discrepancy report.
TestSetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTestSetDiscrepancyReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTestSetDiscrepancyReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTestSetDiscrepancyReport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTestSetDiscrepancyReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTestSetDiscrepancyReport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateTestSetDiscrepancyReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateTestSetDiscrepancyReport",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a pre-signed S3 write URL that you use to upload the zip archive when
// importing a bot or a bot locale.
func (c *Client) CreateUploadUrl(ctx context.Context, params *CreateUploadUrlInput, optFns ...func(*Options)) (*CreateUploadUrlOutput, error) {
if params == nil {
params = &CreateUploadUrlInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateUploadUrl", params, optFns, c.addOperationCreateUploadUrlMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateUploadUrlOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateUploadUrlInput struct {
noSmithyDocumentSerde
}
type CreateUploadUrlOutput struct {
// An identifier for a unique import job. Use it when you call the StartImport (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_StartImport.html)
// operation.
ImportId *string
// A pre-signed S3 write URL. Upload the zip archive file that contains the
// definition of your bot or bot locale.
UploadUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateUploadUrlMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateUploadUrl{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateUploadUrl{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUploadUrl(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateUploadUrl(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateUploadUrl",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes all versions of a bot, including the Draft version. To delete a
// specific version, use the DeleteBotVersion operation. When you delete a bot,
// all of the resources contained in the bot are also deleted. Deleting a bot
// removes all locales, intents, slot, and slot types defined for the bot. If a bot
// has an alias, the DeleteBot operation returns a ResourceInUseException
// exception. If you want to delete the bot and the alias, set the
// skipResourceInUseCheck parameter to true .
func (c *Client) DeleteBot(ctx context.Context, params *DeleteBotInput, optFns ...func(*Options)) (*DeleteBotOutput, error) {
if params == nil {
params = &DeleteBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBot", params, optFns, c.addOperationDeleteBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotInput struct {
// The identifier of the bot to delete.
//
// This member is required.
BotId *string
// By default, Amazon Lex checks if any other resource, such as an alias or bot
// network, is using the bot version before it is deleted and throws a
// ResourceInUseException exception if the bot is being used by another resource.
// Set this parameter to true to skip this check and remove the bot even if it is
// being used by another resource.
SkipResourceInUseCheck bool
noSmithyDocumentSerde
}
type DeleteBotOutput struct {
// The unique identifier of the bot that Amazon Lex is deleting.
BotId *string
// The current status of the bot. The status is Deleting while the bot and its
// associated resources are being deleted.
BotStatus types.BotStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBot",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified bot alias.
func (c *Client) DeleteBotAlias(ctx context.Context, params *DeleteBotAliasInput, optFns ...func(*Options)) (*DeleteBotAliasOutput, error) {
if params == nil {
params = &DeleteBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotAlias", params, optFns, c.addOperationDeleteBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotAliasInput struct {
// The unique identifier of the bot alias to delete.
//
// This member is required.
BotAliasId *string
// The unique identifier of the bot associated with the alias to delete.
//
// This member is required.
BotId *string
// By default, Amazon Lex checks if any other resource, such as a bot network, is
// using the bot alias before it is deleted and throws a ResourceInUseException
// exception if the alias is being used by another resource. Set this parameter to
// true to skip this check and remove the alias even if it is being used by another
// resource.
SkipResourceInUseCheck bool
noSmithyDocumentSerde
}
type DeleteBotAliasOutput struct {
// The unique identifier of the bot alias to delete.
BotAliasId *string
// The current status of the alias. The status is Deleting while the alias is in
// the process of being deleted. Once the alias is deleted, it will no longer
// appear in the list of aliases returned by the ListBotAliases operation.
BotAliasStatus types.BotAliasStatus
// The unique identifier of the bot that contains the alias to delete.
BotId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotAlias",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a locale from a bot. When you delete a locale, all intents, slots, and
// slot types defined for the locale are also deleted.
func (c *Client) DeleteBotLocale(ctx context.Context, params *DeleteBotLocaleInput, optFns ...func(*Options)) (*DeleteBotLocaleOutput, error) {
if params == nil {
params = &DeleteBotLocaleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotLocale", params, optFns, c.addOperationDeleteBotLocaleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotLocaleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotLocaleInput struct {
// The unique identifier of the bot that contains the locale.
//
// This member is required.
BotId *string
// The version of the bot that contains the locale.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that will be deleted. The string must
// match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DeleteBotLocaleOutput struct {
// The identifier of the bot that contained the deleted locale.
BotId *string
// The status of deleting the bot locale. The locale first enters the Deleting
// status. Once the locale is deleted it no longer appears in the list of locales
// for the bot.
BotLocaleStatus types.BotLocaleStatus
// The version of the bot that contained the deleted locale.
BotVersion *string
// The language and locale of the deleted locale.
LocaleId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotLocaleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotLocale{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotLocale{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteBotLocaleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotLocale(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteBotLocale(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotLocale",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a specific version of a bot. To delete all versions of a bot, use the
// DeleteBot (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DeleteBot.html)
// operation.
func (c *Client) DeleteBotVersion(ctx context.Context, params *DeleteBotVersionInput, optFns ...func(*Options)) (*DeleteBotVersionOutput, error) {
if params == nil {
params = &DeleteBotVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotVersion", params, optFns, c.addOperationDeleteBotVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotVersionInput struct {
// The identifier of the bot that contains the version.
//
// This member is required.
BotId *string
// The version of the bot to delete.
//
// This member is required.
BotVersion *string
// By default, Amazon Lex checks if any other resource, such as an alias or bot
// network, is using the bot version before it is deleted and throws a
// ResourceInUseException exception if the version is being used by another
// resource. Set this parameter to true to skip this check and remove the version
// even if it is being used by another resource.
SkipResourceInUseCheck bool
noSmithyDocumentSerde
}
type DeleteBotVersionOutput struct {
// The identifier of the bot that is being deleted.
BotId *string
// The current status of the bot.
BotStatus types.BotStatus
// The version of the bot that is being deleted.
BotVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteBotVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteBotVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotVersion",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a custom vocabulary from the specified locale in the specified bot.
func (c *Client) DeleteCustomVocabulary(ctx context.Context, params *DeleteCustomVocabularyInput, optFns ...func(*Options)) (*DeleteCustomVocabularyOutput, error) {
if params == nil {
params = &DeleteCustomVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCustomVocabulary", params, optFns, c.addOperationDeleteCustomVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCustomVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCustomVocabularyInput struct {
// The unique identifier of the bot to remove the custom vocabulary from.
//
// This member is required.
BotId *string
// The version of the bot to remove the custom vocabulary from.
//
// This member is required.
BotVersion *string
// The locale identifier for the locale that contains the custom vocabulary to
// remove.
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DeleteCustomVocabularyOutput struct {
// The identifier of the bot that the custom vocabulary was removed from.
BotId *string
// The version of the bot that the custom vocabulary was removed from.
BotVersion *string
// The status of removing the custom vocabulary.
CustomVocabularyStatus types.CustomVocabularyStatus
// The locale identifier for the locale that the custom vocabulary was removed
// from.
LocaleId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCustomVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCustomVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCustomVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCustomVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteCustomVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteCustomVocabulary",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a previous export and the associated files stored in an S3 bucket.
func (c *Client) DeleteExport(ctx context.Context, params *DeleteExportInput, optFns ...func(*Options)) (*DeleteExportOutput, error) {
if params == nil {
params = &DeleteExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteExport", params, optFns, c.addOperationDeleteExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteExportInput struct {
// The unique identifier of the export to delete.
//
// This member is required.
ExportId *string
noSmithyDocumentSerde
}
type DeleteExportOutput struct {
// The unique identifier of the deleted export.
ExportId *string
// The current status of the deletion. When the deletion is complete, the export
// will no longer be returned by the ListExports (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListExports.html)
// operation and calls to the DescribeExport (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html)
// operation with the export identifier will fail.
ExportStatus types.ExportStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteExport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteExport",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a previous import and the associated file stored in an S3 bucket.
func (c *Client) DeleteImport(ctx context.Context, params *DeleteImportInput, optFns ...func(*Options)) (*DeleteImportOutput, error) {
if params == nil {
params = &DeleteImportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteImport", params, optFns, c.addOperationDeleteImportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteImportOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteImportInput struct {
// The unique identifier of the import to delete.
//
// This member is required.
ImportId *string
noSmithyDocumentSerde
}
type DeleteImportOutput struct {
// The unique identifier of the deleted import.
ImportId *string
// The current status of the deletion. When the deletion is complete, the import
// will no longer be returned by the ListImports (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListImports.html)
// operation and calls to the DescribeImport (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeImport.html)
// operation with the import identifier will fail.
ImportStatus types.ImportStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteImportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteImport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteImport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteImportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteImport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteImport",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the specified intent. Deleting an intent also deletes the slots
// associated with the intent.
func (c *Client) DeleteIntent(ctx context.Context, params *DeleteIntentInput, optFns ...func(*Options)) (*DeleteIntentOutput, error) {
if params == nil {
params = &DeleteIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIntent", params, optFns, c.addOperationDeleteIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIntentInput struct {
// The identifier of the bot associated with the intent.
//
// This member is required.
BotId *string
// The version of the bot associated with the intent.
//
// This member is required.
BotVersion *string
// The unique identifier of the intent to delete.
//
// This member is required.
IntentId *string
// The identifier of the language and locale where the bot will be deleted. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DeleteIntentOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIntent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntent(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteIntent",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes an existing policy from a bot or bot alias. If the resource doesn't
// have a policy attached, Amazon Lex returns an exception.
func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) {
if params == nil {
params = &DeleteResourcePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteResourcePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteResourcePolicyInput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that has the resource
// policy attached.
//
// This member is required.
ResourceArn *string
// The identifier of the revision to edit. If this ID doesn't match the current
// revision number, Amazon Lex returns an exception If you don't specify a revision
// ID, Amazon Lex will delete the current policy.
ExpectedRevisionId *string
noSmithyDocumentSerde
}
type DeleteResourcePolicyOutput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// was deleted from.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteResourcePolicy",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a policy statement from a resource policy. If you delete the last
// statement from a policy, the policy is deleted. If you specify a statement ID
// that doesn't exist in the policy, or if the bot or bot alias doesn't have a
// policy attached, Amazon Lex returns an exception.
func (c *Client) DeleteResourcePolicyStatement(ctx context.Context, params *DeleteResourcePolicyStatementInput, optFns ...func(*Options)) (*DeleteResourcePolicyStatementOutput, error) {
if params == nil {
params = &DeleteResourcePolicyStatementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicyStatement", params, optFns, c.addOperationDeleteResourcePolicyStatementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteResourcePolicyStatementOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteResourcePolicyStatementInput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
//
// This member is required.
ResourceArn *string
// The name of the statement (SID) to delete from the policy.
//
// This member is required.
StatementId *string
// The identifier of the revision of the policy to delete the statement from. If
// this revision ID doesn't match the current revision ID, Amazon Lex throws an
// exception. If you don't specify a revision, Amazon Lex removes the current
// contents of the statement.
ExpectedRevisionId *string
noSmithyDocumentSerde
}
type DeleteResourcePolicyStatementOutput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// statement was removed from.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteResourcePolicyStatementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePolicyStatement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePolicyStatement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteResourcePolicyStatementValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicyStatement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteResourcePolicyStatement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteResourcePolicyStatement",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified slot from an intent.
func (c *Client) DeleteSlot(ctx context.Context, params *DeleteSlotInput, optFns ...func(*Options)) (*DeleteSlotOutput, error) {
if params == nil {
params = &DeleteSlotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlot", params, optFns, c.addOperationDeleteSlotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlotInput struct {
// The identifier of the bot associated with the slot to delete.
//
// This member is required.
BotId *string
// The version of the bot associated with the slot to delete.
//
// This member is required.
BotVersion *string
// The identifier of the intent associated with the slot.
//
// This member is required.
IntentId *string
// The identifier of the language and locale that the slot will be deleted from.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The identifier of the slot to delete.
//
// This member is required.
SlotId *string
noSmithyDocumentSerde
}
type DeleteSlotOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSlotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSlot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSlot",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a slot type from a bot locale. If a slot is using the slot type, Amazon
// Lex throws a ResourceInUseException exception. To avoid the exception, set the
// skipResourceInUseCheck parameter to true .
func (c *Client) DeleteSlotType(ctx context.Context, params *DeleteSlotTypeInput, optFns ...func(*Options)) (*DeleteSlotTypeOutput, error) {
if params == nil {
params = &DeleteSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlotType", params, optFns, c.addOperationDeleteSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlotTypeInput struct {
// The identifier of the bot associated with the slot type.
//
// This member is required.
BotId *string
// The version of the bot associated with the slot type.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that the slot type will be deleted
// from. The string must match one of the supported locales. For more information,
// see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The identifier of the slot type to delete.
//
// This member is required.
SlotTypeId *string
// By default, the DeleteSlotType operations throws a ResourceInUseException
// exception if you try to delete a slot type used by a slot. Set the
// skipResourceInUseCheck parameter to true to skip this check and remove the slot
// type even if a slot uses it.
SkipResourceInUseCheck bool
noSmithyDocumentSerde
}
type DeleteSlotTypeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlotType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlotType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSlotType",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The action to delete the selected test set.
func (c *Client) DeleteTestSet(ctx context.Context, params *DeleteTestSetInput, optFns ...func(*Options)) (*DeleteTestSetOutput, error) {
if params == nil {
params = &DeleteTestSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTestSet", params, optFns, c.addOperationDeleteTestSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTestSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTestSetInput struct {
// The test set Id of the test set to be deleted.
//
// This member is required.
TestSetId *string
noSmithyDocumentSerde
}
type DeleteTestSetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTestSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTestSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTestSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTestSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTestSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTestSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteTestSet",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes stored utterances. Amazon Lex stores the utterances that users send to
// your bot. Utterances are stored for 15 days for use with the
// ListAggregatedUtterances (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListAggregatedUtterances.html)
// operation, and then stored indefinitely for use in improving the ability of your
// bot to respond to user input.. Use the DeleteUtterances operation to manually
// delete utterances for a specific session. When you use the DeleteUtterances
// operation, utterances stored for improving your bot's ability to respond to user
// input are deleted immediately. Utterances stored for use with the
// ListAggregatedUtterances operation are deleted after 15 days.
func (c *Client) DeleteUtterances(ctx context.Context, params *DeleteUtterancesInput, optFns ...func(*Options)) (*DeleteUtterancesOutput, error) {
if params == nil {
params = &DeleteUtterancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteUtterances", params, optFns, c.addOperationDeleteUtterancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteUtterancesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteUtterancesInput struct {
// The unique identifier of the bot that contains the utterances.
//
// This member is required.
BotId *string
// The identifier of the language and locale where the utterances were collected.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
LocaleId *string
// The unique identifier of the session with the user. The ID is returned in the
// response from the RecognizeText (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeText.html)
// and RecognizeUtterance (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeUtterance.html)
// operations.
SessionId *string
noSmithyDocumentSerde
}
type DeleteUtterancesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteUtterancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteUtterances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteUtterances{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteUtterancesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUtterances(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteUtterances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteUtterances",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Provides metadata information about a bot.
func (c *Client) DescribeBot(ctx context.Context, params *DescribeBotInput, optFns ...func(*Options)) (*DescribeBotOutput, error) {
if params == nil {
params = &DescribeBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBot", params, optFns, c.addOperationDescribeBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBotInput struct {
// The unique identifier of the bot to describe.
//
// This member is required.
BotId *string
noSmithyDocumentSerde
}
type DescribeBotOutput struct {
// The unique identifier of the bot.
BotId *string
// The list of bots in the network that was described.
BotMembers []types.BotMember
// The name of the bot.
BotName *string
// The current status of the bot. When the status is Available the bot is ready to
// be used in conversations with users.
BotStatus types.BotStatus
// The type of the bot that was described.
BotType types.BotType
// A timestamp of the date and time that the bot was created.
CreationDateTime *time.Time
// Settings for managing data privacy of the bot and its conversations with users.
DataPrivacy *types.DataPrivacy
// The description of the bot.
Description *string
// If the botStatus is Failed , this contains a list of reasons that the bot
// couldn't be built.
FailureReasons []string
// The maximum time in seconds that Amazon Lex retains the data gathered in a
// conversation.
IdleSessionTTLInSeconds *int32
// A timestamp of the date and time that the bot was last updated.
LastUpdatedDateTime *time.Time
// The Amazon Resource Name (ARN) of an IAM role that has permission to access the
// bot.
RoleArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeBotAPIClient is a client that implements the DescribeBot operation.
type DescribeBotAPIClient interface {
DescribeBot(context.Context, *DescribeBotInput, ...func(*Options)) (*DescribeBotOutput, error)
}
var _ DescribeBotAPIClient = (*Client)(nil)
// BotAvailableWaiterOptions are waiter options for BotAvailableWaiter
type BotAvailableWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotAvailableWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotAvailableWaiter will use default max delay of 120 seconds. Note
// that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotInput, *DescribeBotOutput, error) (bool, error)
}
// BotAvailableWaiter defines the waiters for BotAvailable
type BotAvailableWaiter struct {
client DescribeBotAPIClient
options BotAvailableWaiterOptions
}
// NewBotAvailableWaiter constructs a BotAvailableWaiter.
func NewBotAvailableWaiter(client DescribeBotAPIClient, optFns ...func(*BotAvailableWaiterOptions)) *BotAvailableWaiter {
options := BotAvailableWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botAvailableStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotAvailableWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotAvailable waiter. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *BotAvailableWaiter) Wait(ctx context.Context, params *DescribeBotInput, maxWaitDur time.Duration, optFns ...func(*BotAvailableWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotAvailable waiter and returns the
// output of the successful operation. The maxWaitDur is the maximum wait duration
// the waiter will wait. The maxWaitDur is required and must be greater than zero.
func (w *BotAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeBotInput, maxWaitDur time.Duration, optFns ...func(*BotAvailableWaiterOptions)) (*DescribeBotOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBot(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotAvailable waiter")
}
func botAvailableStateRetryable(ctx context.Context, input *DescribeBotInput, output *DescribeBotOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Available"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Inactive"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeBot",
}
}
| 384 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Get information about a specific bot alias.
func (c *Client) DescribeBotAlias(ctx context.Context, params *DescribeBotAliasInput, optFns ...func(*Options)) (*DescribeBotAliasOutput, error) {
if params == nil {
params = &DescribeBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBotAlias", params, optFns, c.addOperationDescribeBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBotAliasInput struct {
// The identifier of the bot alias to describe.
//
// This member is required.
BotAliasId *string
// The identifier of the bot associated with the bot alias to describe.
//
// This member is required.
BotId *string
noSmithyDocumentSerde
}
type DescribeBotAliasOutput struct {
// A list of events that affect a bot alias. For example, an event is recorded
// when the version that the alias points to changes.
BotAliasHistoryEvents []types.BotAliasHistoryEvent
// The identifier of the bot alias.
BotAliasId *string
// The locale settings that are unique to the alias.
BotAliasLocaleSettings map[string]types.BotAliasLocaleSettings
// The name of the bot alias.
BotAliasName *string
// The current status of the alias. When the alias is Available , the alias is
// ready for use with your bot.
BotAliasStatus types.BotAliasStatus
// The identifier of the bot associated with the bot alias.
BotId *string
// The version of the bot associated with the bot alias.
BotVersion *string
// Specifics of how Amazon Lex logs text and audio conversations with the bot
// associated with the alias.
ConversationLogSettings *types.ConversationLogSettings
// A timestamp of the date and time that the alias was created.
CreationDateTime *time.Time
// The description of the bot alias.
Description *string
// A timestamp of the date and time that the alias was last updated.
LastUpdatedDateTime *time.Time
// A list of the networks to which the bot alias you described belongs.
ParentBotNetworks []types.ParentBotNetwork
// Determines whether Amazon Lex will use Amazon Comprehend to detect the
// sentiment of user utterances.
SentimentAnalysisSettings *types.SentimentAnalysisSettings
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBotAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBotAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeBotAliasAPIClient is a client that implements the DescribeBotAlias
// operation.
type DescribeBotAliasAPIClient interface {
DescribeBotAlias(context.Context, *DescribeBotAliasInput, ...func(*Options)) (*DescribeBotAliasOutput, error)
}
var _ DescribeBotAliasAPIClient = (*Client)(nil)
// BotAliasAvailableWaiterOptions are waiter options for BotAliasAvailableWaiter
type BotAliasAvailableWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotAliasAvailableWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotAliasAvailableWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotAliasInput, *DescribeBotAliasOutput, error) (bool, error)
}
// BotAliasAvailableWaiter defines the waiters for BotAliasAvailable
type BotAliasAvailableWaiter struct {
client DescribeBotAliasAPIClient
options BotAliasAvailableWaiterOptions
}
// NewBotAliasAvailableWaiter constructs a BotAliasAvailableWaiter.
func NewBotAliasAvailableWaiter(client DescribeBotAliasAPIClient, optFns ...func(*BotAliasAvailableWaiterOptions)) *BotAliasAvailableWaiter {
options := BotAliasAvailableWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botAliasAvailableStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotAliasAvailableWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotAliasAvailable waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *BotAliasAvailableWaiter) Wait(ctx context.Context, params *DescribeBotAliasInput, maxWaitDur time.Duration, optFns ...func(*BotAliasAvailableWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotAliasAvailable waiter and
// returns the output of the successful operation. The maxWaitDur is the maximum
// wait duration the waiter will wait. The maxWaitDur is required and must be
// greater than zero.
func (w *BotAliasAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeBotAliasInput, maxWaitDur time.Duration, optFns ...func(*BotAliasAvailableWaiterOptions)) (*DescribeBotAliasOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBotAlias(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotAliasAvailable waiter")
}
func botAliasAvailableStateRetryable(ctx context.Context, input *DescribeBotAliasInput, output *DescribeBotAliasOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botAliasStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Available"
value, ok := pathValue.(types.BotAliasStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotAliasStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botAliasStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotAliasStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotAliasStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botAliasStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotAliasStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotAliasStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeBotAlias",
}
}
| 377 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Describes the settings that a bot has for a specific locale.
func (c *Client) DescribeBotLocale(ctx context.Context, params *DescribeBotLocaleInput, optFns ...func(*Options)) (*DescribeBotLocaleOutput, error) {
if params == nil {
params = &DescribeBotLocaleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBotLocale", params, optFns, c.addOperationDescribeBotLocaleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBotLocaleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBotLocaleInput struct {
// The identifier of the bot associated with the locale.
//
// This member is required.
BotId *string
// The version of the bot associated with the locale.
//
// This member is required.
BotVersion *string
// The unique identifier of the locale to describe. The string must match one of
// the supported locales. For more information, see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DescribeBotLocaleOutput struct {
// The identifier of the bot associated with the locale.
BotId *string
// History of changes, such as when a locale is used in an alias, that have taken
// place for the locale.
BotLocaleHistoryEvents []types.BotLocaleHistoryEvent
// The status of the bot. If the status is Failed , the reasons for the failure are
// listed in the failureReasons field.
BotLocaleStatus types.BotLocaleStatus
// The version of the bot associated with the locale.
BotVersion *string
// The date and time that the locale was created.
CreationDateTime *time.Time
// The description of the locale.
Description *string
// if botLocaleStatus is Failed , Amazon Lex explains why it failed to build the
// bot.
FailureReasons []string
// The number of intents defined for the locale.
IntentsCount *int32
// The date and time that the locale was last submitted for building.
LastBuildSubmittedDateTime *time.Time
// The date and time that the locale was last updated.
LastUpdatedDateTime *time.Time
// The unique identifier of the described locale.
LocaleId *string
// The name of the locale.
LocaleName *string
// The confidence threshold where Amazon Lex inserts the AMAZON.FallbackIntent and
// AMAZON.KendraSearchIntent intents in the list of possible intents for an
// utterance.
NluIntentConfidenceThreshold *float64
// Recommended actions to take to resolve an error in the failureReasons field.
RecommendedActions []string
// The number of slot types defined for the locale.
SlotTypesCount *int32
// The Amazon Polly voice Amazon Lex uses for voice interaction with the user.
VoiceSettings *types.VoiceSettings
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBotLocaleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBotLocale{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBotLocale{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBotLocaleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBotLocale(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeBotLocaleAPIClient is a client that implements the DescribeBotLocale
// operation.
type DescribeBotLocaleAPIClient interface {
DescribeBotLocale(context.Context, *DescribeBotLocaleInput, ...func(*Options)) (*DescribeBotLocaleOutput, error)
}
var _ DescribeBotLocaleAPIClient = (*Client)(nil)
// BotLocaleBuiltWaiterOptions are waiter options for BotLocaleBuiltWaiter
type BotLocaleBuiltWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotLocaleBuiltWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotLocaleBuiltWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotLocaleInput, *DescribeBotLocaleOutput, error) (bool, error)
}
// BotLocaleBuiltWaiter defines the waiters for BotLocaleBuilt
type BotLocaleBuiltWaiter struct {
client DescribeBotLocaleAPIClient
options BotLocaleBuiltWaiterOptions
}
// NewBotLocaleBuiltWaiter constructs a BotLocaleBuiltWaiter.
func NewBotLocaleBuiltWaiter(client DescribeBotLocaleAPIClient, optFns ...func(*BotLocaleBuiltWaiterOptions)) *BotLocaleBuiltWaiter {
options := BotLocaleBuiltWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botLocaleBuiltStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotLocaleBuiltWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotLocaleBuilt waiter. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *BotLocaleBuiltWaiter) Wait(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleBuiltWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotLocaleBuilt waiter and returns
// the output of the successful operation. The maxWaitDur is the maximum wait
// duration the waiter will wait. The maxWaitDur is required and must be greater
// than zero.
func (w *BotLocaleBuiltWaiter) WaitForOutput(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleBuiltWaiterOptions)) (*DescribeBotLocaleOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBotLocale(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotLocaleBuilt waiter")
}
func botLocaleBuiltStateRetryable(ctx context.Context, input *DescribeBotLocaleInput, output *DescribeBotLocaleOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Built"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "NotBuilt"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
// BotLocaleCreatedWaiterOptions are waiter options for BotLocaleCreatedWaiter
type BotLocaleCreatedWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotLocaleCreatedWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotLocaleCreatedWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotLocaleInput, *DescribeBotLocaleOutput, error) (bool, error)
}
// BotLocaleCreatedWaiter defines the waiters for BotLocaleCreated
type BotLocaleCreatedWaiter struct {
client DescribeBotLocaleAPIClient
options BotLocaleCreatedWaiterOptions
}
// NewBotLocaleCreatedWaiter constructs a BotLocaleCreatedWaiter.
func NewBotLocaleCreatedWaiter(client DescribeBotLocaleAPIClient, optFns ...func(*BotLocaleCreatedWaiterOptions)) *BotLocaleCreatedWaiter {
options := BotLocaleCreatedWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botLocaleCreatedStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotLocaleCreatedWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotLocaleCreated waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *BotLocaleCreatedWaiter) Wait(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleCreatedWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotLocaleCreated waiter and returns
// the output of the successful operation. The maxWaitDur is the maximum wait
// duration the waiter will wait. The maxWaitDur is required and must be greater
// than zero.
func (w *BotLocaleCreatedWaiter) WaitForOutput(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleCreatedWaiterOptions)) (*DescribeBotLocaleOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBotLocale(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotLocaleCreated waiter")
}
func botLocaleCreatedStateRetryable(ctx context.Context, input *DescribeBotLocaleInput, output *DescribeBotLocaleOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Built"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "ReadyExpressTesting"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "NotBuilt"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
// BotLocaleExpressTestingAvailableWaiterOptions are waiter options for
// BotLocaleExpressTestingAvailableWaiter
type BotLocaleExpressTestingAvailableWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotLocaleExpressTestingAvailableWaiter will use default minimum delay of 10
// seconds. Note that MinDelay must resolve to a value lesser than or equal to the
// MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotLocaleExpressTestingAvailableWaiter will use default max delay
// of 120 seconds. Note that MaxDelay must resolve to value greater than or equal
// to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotLocaleInput, *DescribeBotLocaleOutput, error) (bool, error)
}
// BotLocaleExpressTestingAvailableWaiter defines the waiters for
// BotLocaleExpressTestingAvailable
type BotLocaleExpressTestingAvailableWaiter struct {
client DescribeBotLocaleAPIClient
options BotLocaleExpressTestingAvailableWaiterOptions
}
// NewBotLocaleExpressTestingAvailableWaiter constructs a
// BotLocaleExpressTestingAvailableWaiter.
func NewBotLocaleExpressTestingAvailableWaiter(client DescribeBotLocaleAPIClient, optFns ...func(*BotLocaleExpressTestingAvailableWaiterOptions)) *BotLocaleExpressTestingAvailableWaiter {
options := BotLocaleExpressTestingAvailableWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botLocaleExpressTestingAvailableStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotLocaleExpressTestingAvailableWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotLocaleExpressTestingAvailable waiter. The
// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is
// required and must be greater than zero.
func (w *BotLocaleExpressTestingAvailableWaiter) Wait(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleExpressTestingAvailableWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotLocaleExpressTestingAvailable
// waiter and returns the output of the successful operation. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *BotLocaleExpressTestingAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeBotLocaleInput, maxWaitDur time.Duration, optFns ...func(*BotLocaleExpressTestingAvailableWaiterOptions)) (*DescribeBotLocaleOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBotLocale(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotLocaleExpressTestingAvailable waiter")
}
func botLocaleExpressTestingAvailableStateRetryable(ctx context.Context, input *DescribeBotLocaleInput, output *DescribeBotLocaleOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Built"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "ReadyExpressTesting"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botLocaleStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "NotBuilt"
value, ok := pathValue.(types.BotLocaleStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotLocaleStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeBotLocale(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeBotLocale",
}
}
| 872 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides metadata information about a bot recommendation. This information will
// enable you to get a description on the request inputs, to download associated
// transcripts after processing is complete, and to download intents and slot-types
// generated by the bot recommendation.
func (c *Client) DescribeBotRecommendation(ctx context.Context, params *DescribeBotRecommendationInput, optFns ...func(*Options)) (*DescribeBotRecommendationOutput, error) {
if params == nil {
params = &DescribeBotRecommendationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBotRecommendation", params, optFns, c.addOperationDescribeBotRecommendationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBotRecommendationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBotRecommendationInput struct {
// The unique identifier of the bot associated with the bot recommendation.
//
// This member is required.
BotId *string
// The identifier of the bot recommendation to describe.
//
// This member is required.
BotRecommendationId *string
// The version of the bot associated with the bot recommendation.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the bot recommendation to
// describe. The string must match one of the supported locales. For more
// information, see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DescribeBotRecommendationOutput struct {
// The identifier of the bot associated with the bot recommendation.
BotId *string
// The identifier of the bot recommendation being described.
BotRecommendationId *string
// The object representing the URL of the bot definition, the URL of the
// associated transcript and a statistical summary of the bot recommendation
// results.
BotRecommendationResults *types.BotRecommendationResults
// The status of the bot recommendation. If the status is Failed, then the reasons
// for the failure are listed in the failureReasons field.
BotRecommendationStatus types.BotRecommendationStatus
// The version of the bot associated with the bot recommendation.
BotVersion *string
// The date and time that the bot recommendation was created.
CreationDateTime *time.Time
// The object representing the passwords that were used to encrypt the data
// related to the bot recommendation results, as well as the KMS key ARN used to
// encrypt the associated metadata.
EncryptionSetting *types.EncryptionSetting
// If botRecommendationStatus is Failed, Amazon Lex explains why.
FailureReasons []string
// The date and time that the bot recommendation was last updated.
LastUpdatedDateTime *time.Time
// The identifier of the language and locale of the bot recommendation to describe.
LocaleId *string
// The object representing the Amazon S3 bucket containing the transcript, as well
// as the associated metadata.
TranscriptSourceSetting *types.TranscriptSourceSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBotRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBotRecommendation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBotRecommendation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBotRecommendationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBotRecommendation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeBotRecommendation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeBotRecommendation",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"errors"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Provides metadata about a version of a bot.
func (c *Client) DescribeBotVersion(ctx context.Context, params *DescribeBotVersionInput, optFns ...func(*Options)) (*DescribeBotVersionOutput, error) {
if params == nil {
params = &DescribeBotVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBotVersion", params, optFns, c.addOperationDescribeBotVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBotVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBotVersionInput struct {
// The identifier of the bot containing the version to return metadata for.
//
// This member is required.
BotId *string
// The version of the bot to return metadata for.
//
// This member is required.
BotVersion *string
noSmithyDocumentSerde
}
type DescribeBotVersionOutput struct {
// The identifier of the bot that contains the version.
BotId *string
// The members of bot network in the version that was described.
BotMembers []types.BotMember
// The name of the bot that contains the version.
BotName *string
// The current status of the bot. When the status is Available , the bot version is
// ready for use.
BotStatus types.BotStatus
// The type of the bot in the version that was described.
BotType types.BotType
// The version of the bot that was described.
BotVersion *string
// A timestamp of the date and time that the bot version was created.
CreationDateTime *time.Time
// Data privacy settings for the bot version.
DataPrivacy *types.DataPrivacy
// The description specified for the bot.
Description *string
// If the botStatus is Failed , this contains a list of reasons that the version
// couldn't be built.
FailureReasons []string
// The number of seconds that a session with the bot remains active before it is
// discarded by Amazon Lex.
IdleSessionTTLInSeconds *int32
// A list of the networks to which the bot version you described belongs.
ParentBotNetworks []types.ParentBotNetwork
// The Amazon Resource Name (ARN) of an IAM role that has permission to access the
// bot version.
RoleArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBotVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBotVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBotVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBotVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBotVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeBotVersionAPIClient is a client that implements the DescribeBotVersion
// operation.
type DescribeBotVersionAPIClient interface {
DescribeBotVersion(context.Context, *DescribeBotVersionInput, ...func(*Options)) (*DescribeBotVersionOutput, error)
}
var _ DescribeBotVersionAPIClient = (*Client)(nil)
// BotVersionAvailableWaiterOptions are waiter options for
// BotVersionAvailableWaiter
type BotVersionAvailableWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotVersionAvailableWaiter will use default minimum delay of 10 seconds. Note
// that MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotVersionAvailableWaiter will use default max delay of 120
// seconds. Note that MaxDelay must resolve to value greater than or equal to the
// MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeBotVersionInput, *DescribeBotVersionOutput, error) (bool, error)
}
// BotVersionAvailableWaiter defines the waiters for BotVersionAvailable
type BotVersionAvailableWaiter struct {
client DescribeBotVersionAPIClient
options BotVersionAvailableWaiterOptions
}
// NewBotVersionAvailableWaiter constructs a BotVersionAvailableWaiter.
func NewBotVersionAvailableWaiter(client DescribeBotVersionAPIClient, optFns ...func(*BotVersionAvailableWaiterOptions)) *BotVersionAvailableWaiter {
options := BotVersionAvailableWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botVersionAvailableStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotVersionAvailableWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotVersionAvailable waiter. The maxWaitDur
// is the maximum wait duration the waiter will wait. The maxWaitDur is required
// and must be greater than zero.
func (w *BotVersionAvailableWaiter) Wait(ctx context.Context, params *DescribeBotVersionInput, maxWaitDur time.Duration, optFns ...func(*BotVersionAvailableWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotVersionAvailable waiter and
// returns the output of the successful operation. The maxWaitDur is the maximum
// wait duration the waiter will wait. The maxWaitDur is required and must be
// greater than zero.
func (w *BotVersionAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeBotVersionInput, maxWaitDur time.Duration, optFns ...func(*BotVersionAvailableWaiterOptions)) (*DescribeBotVersionOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeBotVersion(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotVersionAvailable waiter")
}
func botVersionAvailableStateRetryable(ctx context.Context, input *DescribeBotVersionInput, output *DescribeBotVersionOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Available"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("botStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.BotStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.BotStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err != nil {
var errorType *types.ResourceNotFoundException
if errors.As(err, &errorType) {
return true, nil
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeBotVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeBotVersion",
}
}
| 387 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides metadata information about a custom vocabulary.
func (c *Client) DescribeCustomVocabularyMetadata(ctx context.Context, params *DescribeCustomVocabularyMetadataInput, optFns ...func(*Options)) (*DescribeCustomVocabularyMetadataOutput, error) {
if params == nil {
params = &DescribeCustomVocabularyMetadataInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCustomVocabularyMetadata", params, optFns, c.addOperationDescribeCustomVocabularyMetadataMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCustomVocabularyMetadataOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCustomVocabularyMetadataInput struct {
// The unique identifier of the bot that contains the custom vocabulary.
//
// This member is required.
BotId *string
// The bot version of the bot to return metadata for.
//
// This member is required.
BotVersion *string
// The locale to return the custom vocabulary information for. The locale must be
// en_GB .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DescribeCustomVocabularyMetadataOutput struct {
// The identifier of the bot that contains the custom vocabulary.
BotId *string
// The version of the bot that contains the custom vocabulary to describe.
BotVersion *string
// The date and time that the custom vocabulary was created.
CreationDateTime *time.Time
// The status of the custom vocabulary. If the status is Ready the custom
// vocabulary is ready to use.
CustomVocabularyStatus types.CustomVocabularyStatus
// The date and time that the custom vocabulary was last updated.
LastUpdatedDateTime *time.Time
// The locale that contains the custom vocabulary to describe.
LocaleId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCustomVocabularyMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCustomVocabularyMetadata{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCustomVocabularyMetadata{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeCustomVocabularyMetadataValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCustomVocabularyMetadata(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeCustomVocabularyMetadata(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeCustomVocabularyMetadata",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Gets information about a specific export.
func (c *Client) DescribeExport(ctx context.Context, params *DescribeExportInput, optFns ...func(*Options)) (*DescribeExportOutput, error) {
if params == nil {
params = &DescribeExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeExport", params, optFns, c.addOperationDescribeExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeExportInput struct {
// The unique identifier of the export to describe.
//
// This member is required.
ExportId *string
noSmithyDocumentSerde
}
type DescribeExportOutput struct {
// The date and time that the export was created.
CreationDateTime *time.Time
// A pre-signed S3 URL that points to the bot or bot locale archive. The URL is
// only available for 5 minutes after calling the DescribeExport operation.
DownloadUrl *string
// The unique identifier of the described export.
ExportId *string
// The status of the export. When the status is Complete the export archive file
// is available for download.
ExportStatus types.ExportStatus
// If the exportStatus is failed, contains one or more reasons why the export
// could not be completed.
FailureReasons []string
// The file format used in the files that describe the resource.
FileFormat types.ImportExportFileFormat
// The last date and time that the export was updated.
LastUpdatedDateTime *time.Time
// The bot, bot ID, and optional locale ID of the exported bot or bot locale.
ResourceSpecification *types.ExportResourceSpecification
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeExportAPIClient is a client that implements the DescribeExport
// operation.
type DescribeExportAPIClient interface {
DescribeExport(context.Context, *DescribeExportInput, ...func(*Options)) (*DescribeExportOutput, error)
}
var _ DescribeExportAPIClient = (*Client)(nil)
// BotExportCompletedWaiterOptions are waiter options for BotExportCompletedWaiter
type BotExportCompletedWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotExportCompletedWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotExportCompletedWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeExportInput, *DescribeExportOutput, error) (bool, error)
}
// BotExportCompletedWaiter defines the waiters for BotExportCompleted
type BotExportCompletedWaiter struct {
client DescribeExportAPIClient
options BotExportCompletedWaiterOptions
}
// NewBotExportCompletedWaiter constructs a BotExportCompletedWaiter.
func NewBotExportCompletedWaiter(client DescribeExportAPIClient, optFns ...func(*BotExportCompletedWaiterOptions)) *BotExportCompletedWaiter {
options := BotExportCompletedWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botExportCompletedStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotExportCompletedWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotExportCompleted waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *BotExportCompletedWaiter) Wait(ctx context.Context, params *DescribeExportInput, maxWaitDur time.Duration, optFns ...func(*BotExportCompletedWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotExportCompleted waiter and
// returns the output of the successful operation. The maxWaitDur is the maximum
// wait duration the waiter will wait. The maxWaitDur is required and must be
// greater than zero.
func (w *BotExportCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeExportInput, maxWaitDur time.Duration, optFns ...func(*BotExportCompletedWaiterOptions)) (*DescribeExportOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeExport(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotExportCompleted waiter")
}
func botExportCompletedStateRetryable(ctx context.Context, input *DescribeExportInput, output *DescribeExportOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("exportStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Completed"
value, ok := pathValue.(types.ExportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ExportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("exportStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.ExportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ExportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("exportStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.ExportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ExportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeExport",
}
}
| 356 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Gets information about a specific import.
func (c *Client) DescribeImport(ctx context.Context, params *DescribeImportInput, optFns ...func(*Options)) (*DescribeImportOutput, error) {
if params == nil {
params = &DescribeImportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeImport", params, optFns, c.addOperationDescribeImportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeImportOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeImportInput struct {
// The unique identifier of the import to describe.
//
// This member is required.
ImportId *string
noSmithyDocumentSerde
}
type DescribeImportOutput struct {
// The date and time that the import was created.
CreationDateTime *time.Time
// If the importStatus field is Failed , this provides one or more reasons for the
// failure.
FailureReasons []string
// The unique identifier of the described import.
ImportId *string
// The status of the import process. When the status is Completed the resource is
// imported and ready for use.
ImportStatus types.ImportStatus
// The unique identifier that Amazon Lex assigned to the resource created by the
// import.
ImportedResourceId *string
// The name of the imported resource.
ImportedResourceName *string
// The date and time that the import was last updated.
LastUpdatedDateTime *time.Time
// The strategy used when there was a name conflict between the imported resource
// and an existing resource. When the merge strategy is FailOnConflict existing
// resources are not overwritten and the import fails.
MergeStrategy types.MergeStrategy
// The specifications of the imported bot, bot locale, or custom vocabulary.
ResourceSpecification *types.ImportResourceSpecification
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeImport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeImport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeImportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeImportAPIClient is a client that implements the DescribeImport
// operation.
type DescribeImportAPIClient interface {
DescribeImport(context.Context, *DescribeImportInput, ...func(*Options)) (*DescribeImportOutput, error)
}
var _ DescribeImportAPIClient = (*Client)(nil)
// BotImportCompletedWaiterOptions are waiter options for BotImportCompletedWaiter
type BotImportCompletedWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// BotImportCompletedWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, BotImportCompletedWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeImportInput, *DescribeImportOutput, error) (bool, error)
}
// BotImportCompletedWaiter defines the waiters for BotImportCompleted
type BotImportCompletedWaiter struct {
client DescribeImportAPIClient
options BotImportCompletedWaiterOptions
}
// NewBotImportCompletedWaiter constructs a BotImportCompletedWaiter.
func NewBotImportCompletedWaiter(client DescribeImportAPIClient, optFns ...func(*BotImportCompletedWaiterOptions)) *BotImportCompletedWaiter {
options := BotImportCompletedWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = botImportCompletedStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &BotImportCompletedWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for BotImportCompleted waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *BotImportCompletedWaiter) Wait(ctx context.Context, params *DescribeImportInput, maxWaitDur time.Duration, optFns ...func(*BotImportCompletedWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for BotImportCompleted waiter and
// returns the output of the successful operation. The maxWaitDur is the maximum
// wait duration the waiter will wait. The maxWaitDur is required and must be
// greater than zero.
func (w *BotImportCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeImportInput, maxWaitDur time.Duration, optFns ...func(*BotImportCompletedWaiterOptions)) (*DescribeImportOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeImport(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for BotImportCompleted waiter")
}
func botImportCompletedStateRetryable(ctx context.Context, input *DescribeImportInput, output *DescribeImportOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("importStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Completed"
value, ok := pathValue.(types.ImportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ImportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("importStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Deleting"
value, ok := pathValue.(types.ImportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ImportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("importStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.ImportStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.ImportStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeImport",
}
}
| 361 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns metadata about an intent.
func (c *Client) DescribeIntent(ctx context.Context, params *DescribeIntentInput, optFns ...func(*Options)) (*DescribeIntentOutput, error) {
if params == nil {
params = &DescribeIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeIntent", params, optFns, c.addOperationDescribeIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeIntentInput struct {
// The identifier of the bot associated with the intent.
//
// This member is required.
BotId *string
// The version of the bot associated with the intent.
//
// This member is required.
BotVersion *string
// The identifier of the intent to describe.
//
// This member is required.
IntentId *string
// The identifier of the language and locale of the intent to describe. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type DescribeIntentOutput struct {
// The identifier of the bot associated with the intent.
BotId *string
// The version of the bot associated with the intent.
BotVersion *string
// A timestamp of the date and time that the intent was created.
CreationDateTime *time.Time
// The description of the intent.
Description *string
// The Lambda function called during each turn of a conversation with the intent.
DialogCodeHook *types.DialogCodeHookSettings
// The Lambda function called when the intent is complete and ready for
// fulfillment.
FulfillmentCodeHook *types.FulfillmentCodeHookSettings
// Configuration setting for a response sent to the user before Amazon Lex starts
// eliciting slots.
InitialResponseSetting *types.InitialResponseSetting
// A list of contexts that must be active for the intent to be considered for
// sending to the user.
InputContexts []types.InputContext
// The response that Amazon Lex sends to when the intent is closed.
IntentClosingSetting *types.IntentClosingSetting
// Prompts that Amazon Lex sends to the user to confirm completion of an intent.
IntentConfirmationSetting *types.IntentConfirmationSetting
// The unique identifier assigned to the intent when it was created.
IntentId *string
// The name specified for the intent.
IntentName *string
// Configuration information required to use the AMAZON.KendraSearchIntent intent.
KendraConfiguration *types.KendraConfiguration
// A timestamp of the date and time that the intent was last updated.
LastUpdatedDateTime *time.Time
// The language and locale specified for the intent.
LocaleId *string
// A list of contexts that are activated when the intent is fulfilled.
OutputContexts []types.OutputContext
// The identifier of the built-in intent that this intent is derived from, if any.
ParentIntentSignature *string
// User utterances that trigger this intent.
SampleUtterances []types.SampleUtterance
// The list that determines the priority that slots should be elicited from the
// user.
SlotPriorities []types.SlotPriority
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeIntent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIntent(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeIntent",
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the resource policy and policy revision for a bot or bot alias.
func (c *Client) DescribeResourcePolicy(ctx context.Context, params *DescribeResourcePolicyInput, optFns ...func(*Options)) (*DescribeResourcePolicyOutput, error) {
if params == nil {
params = &DescribeResourcePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeResourcePolicy", params, optFns, c.addOperationDescribeResourcePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeResourcePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeResourcePolicyInput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type DescribeResourcePolicyOutput struct {
// The JSON structure that contains the resource policy. For more information
// about the contents of a JSON policy document, see IAM JSON policy reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)
// .
Policy *string
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeResourcePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeResourcePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeResourcePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeResourcePolicy",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about a slot.
func (c *Client) DescribeSlot(ctx context.Context, params *DescribeSlotInput, optFns ...func(*Options)) (*DescribeSlotOutput, error) {
if params == nil {
params = &DescribeSlotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSlot", params, optFns, c.addOperationDescribeSlotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSlotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSlotInput struct {
// The identifier of the bot associated with the slot.
//
// This member is required.
BotId *string
// The version of the bot associated with the slot.
//
// This member is required.
BotVersion *string
// The identifier of the intent that contains the slot.
//
// This member is required.
IntentId *string
// The identifier of the language and locale of the slot to describe. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// The unique identifier for the slot.
//
// This member is required.
SlotId *string
noSmithyDocumentSerde
}
type DescribeSlotOutput struct {
// The identifier of the bot associated with the slot.
BotId *string
// The version of the bot associated with the slot.
BotVersion *string
// A timestamp of the date and time that the slot was created.
CreationDateTime *time.Time
// The description specified for the slot.
Description *string
// The identifier of the intent associated with the slot.
IntentId *string
// A timestamp of the date and time that the slot was last updated.
LastUpdatedDateTime *time.Time
// The language and locale specified for the slot.
LocaleId *string
// Indicates whether the slot accepts multiple values in a single utterance. If
// the multipleValuesSetting is not set, the default value is false .
MultipleValuesSetting *types.MultipleValuesSetting
// Whether slot values are shown in Amazon CloudWatch logs. If the value is None ,
// the actual value of the slot is shown in logs.
ObfuscationSetting *types.ObfuscationSetting
// The unique identifier generated for the slot.
SlotId *string
// The name specified for the slot.
SlotName *string
// The identifier of the slot type that determines the values entered into the
// slot.
SlotTypeId *string
// Specifications for the constituent sub slots and the expression for the
// composite slot.
SubSlotSetting *types.SubSlotSetting
// Prompts that Amazon Lex uses to elicit a value for the slot.
ValueElicitationSetting *types.SlotValueElicitationSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSlotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSlot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSlot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSlotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSlot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSlot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeSlot",
}
}
| 191 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about a slot type.
func (c *Client) DescribeSlotType(ctx context.Context, params *DescribeSlotTypeInput, optFns ...func(*Options)) (*DescribeSlotTypeOutput, error) {
if params == nil {
params = &DescribeSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSlotType", params, optFns, c.addOperationDescribeSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSlotTypeInput struct {
// The identifier of the bot associated with the slot type.
//
// This member is required.
BotId *string
// The version of the bot associated with the slot type.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the slot type to describe. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The identifier of the slot type.
//
// This member is required.
SlotTypeId *string
noSmithyDocumentSerde
}
type DescribeSlotTypeOutput struct {
// The identifier of the bot associated with the slot type.
BotId *string
// The version of the bot associated with the slot type.
BotVersion *string
// Specifications for a composite slot type.
CompositeSlotTypeSetting *types.CompositeSlotTypeSetting
// A timestamp of the date and time that the slot type was created.
CreationDateTime *time.Time
// The description specified for the slot type.
Description *string
// Provides information about the external source of the slot type's definition.
ExternalSourceSetting *types.ExternalSourceSetting
// A timestamp of the date and time that the slot type was last updated.
LastUpdatedDateTime *time.Time
// The language and locale specified for the slot type.
LocaleId *string
// The built in slot type used as a parent to this slot type.
ParentSlotTypeSignature *string
// The unique identifier for the slot type.
SlotTypeId *string
// The name specified for the slot type.
SlotTypeName *string
// The values that the slot type can take. Includes any synonyms for the slot type
// values.
SlotTypeValues []types.SlotTypeValue
// The strategy that Amazon Lex uses to choose a value from a list of possible
// values.
ValueSelectionSetting *types.SlotValueSelectionSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSlotType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSlotType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeSlotType",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about the test execution.
func (c *Client) DescribeTestExecution(ctx context.Context, params *DescribeTestExecutionInput, optFns ...func(*Options)) (*DescribeTestExecutionOutput, error) {
if params == nil {
params = &DescribeTestExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTestExecution", params, optFns, c.addOperationDescribeTestExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTestExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTestExecutionInput struct {
// The execution Id of the test set execution.
//
// This member is required.
TestExecutionId *string
noSmithyDocumentSerde
}
type DescribeTestExecutionOutput struct {
// Indicates whether we use streaming or non-streaming APIs are used for the test
// set execution. For streaming, StartConversation Amazon Lex Runtime API is used.
// Whereas for non-streaming, RecognizeUtterance and RecognizeText Amazon Lex
// Runtime API is used.
ApiMode types.TestExecutionApiMode
// The execution creation date and time for the test set execution.
CreationDateTime *time.Time
// Reasons for the failure of the test set execution.
FailureReasons []string
// The date and time of the last update for the execution.
LastUpdatedDateTime *time.Time
// The target bot for the test set execution details.
Target *types.TestExecutionTarget
// The execution Id for the test set execution.
TestExecutionId *string
// Indicates whether test set is audio or text.
TestExecutionModality types.TestExecutionModality
// The test execution status for the test execution.
TestExecutionStatus types.TestExecutionStatus
// The test set Id for the test set execution.
TestSetId *string
// The test set name of the test set execution.
TestSetName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTestExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTestExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTestExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTestExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTestExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeTestExecution",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about the test set.
func (c *Client) DescribeTestSet(ctx context.Context, params *DescribeTestSetInput, optFns ...func(*Options)) (*DescribeTestSetOutput, error) {
if params == nil {
params = &DescribeTestSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTestSet", params, optFns, c.addOperationDescribeTestSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTestSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTestSetInput struct {
// The test set Id for the test set request.
//
// This member is required.
TestSetId *string
noSmithyDocumentSerde
}
type DescribeTestSetOutput struct {
// The creation date and time for the test set data.
CreationDateTime *time.Time
// The description of the test set.
Description *string
// The date and time for the last update of the test set data.
LastUpdatedDateTime *time.Time
// Indicates whether the test set is audio or text data.
Modality types.TestSetModality
// The total number of agent and user turn in the test set.
NumTurns *int32
// The roleARN used for any operation in the test set to access resources in the
// Amazon Web Services account.
RoleArn *string
// The status of the test set.
Status types.TestSetStatus
// The Amazon S3 storage location for the test set data.
StorageLocation *types.TestSetStorageLocation
// The test set Id for the test set response.
TestSetId *string
// The test set name of the test set.
TestSetName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTestSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTestSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTestSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTestSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTestSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTestSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeTestSet",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about the test set discrepancy report.
func (c *Client) DescribeTestSetDiscrepancyReport(ctx context.Context, params *DescribeTestSetDiscrepancyReportInput, optFns ...func(*Options)) (*DescribeTestSetDiscrepancyReportOutput, error) {
if params == nil {
params = &DescribeTestSetDiscrepancyReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTestSetDiscrepancyReport", params, optFns, c.addOperationDescribeTestSetDiscrepancyReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTestSetDiscrepancyReportOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTestSetDiscrepancyReportInput struct {
// The unique identifier of the test set discrepancy report.
//
// This member is required.
TestSetDiscrepancyReportId *string
noSmithyDocumentSerde
}
type DescribeTestSetDiscrepancyReportOutput struct {
// The time and date of creation for the test set discrepancy report.
CreationDateTime *time.Time
// The failure report for the test set discrepancy report generation action.
FailureReasons []string
// The date and time of the last update for the test set discrepancy report.
LastUpdatedDataTime *time.Time
// The target bot location for the test set discrepancy report.
Target *types.TestSetDiscrepancyReportResourceTarget
// Pre-signed Amazon S3 URL to download the test set discrepancy report.
TestSetDiscrepancyRawOutputUrl *string
// The unique identifier of the test set discrepancy report to describe.
TestSetDiscrepancyReportId *string
// The status for the test set discrepancy report.
TestSetDiscrepancyReportStatus types.TestSetDiscrepancyReportStatus
// The top 200 error results from the test set discrepancy report.
TestSetDiscrepancyTopErrors *types.TestSetDiscrepancyErrors
// The test set Id for the test set discrepancy report.
TestSetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTestSetDiscrepancyReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTestSetDiscrepancyReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTestSetDiscrepancyReport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTestSetDiscrepancyReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTestSetDiscrepancyReport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTestSetDiscrepancyReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeTestSetDiscrepancyReport",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets metadata information about the test set generation.
func (c *Client) DescribeTestSetGeneration(ctx context.Context, params *DescribeTestSetGenerationInput, optFns ...func(*Options)) (*DescribeTestSetGenerationOutput, error) {
if params == nil {
params = &DescribeTestSetGenerationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTestSetGeneration", params, optFns, c.addOperationDescribeTestSetGenerationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTestSetGenerationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTestSetGenerationInput struct {
// The unique identifier of the test set generation.
//
// This member is required.
TestSetGenerationId *string
noSmithyDocumentSerde
}
type DescribeTestSetGenerationOutput struct {
// The creation date and time for the test set generation.
CreationDateTime *time.Time
// The test set description for the test set generation.
Description *string
// The reasons the test set generation failed.
FailureReasons []string
// The data source of the test set used for the test set generation.
GenerationDataSource *types.TestSetGenerationDataSource
// The date and time of the last update for the test set generation.
LastUpdatedDateTime *time.Time
// The roleARN of the test set used for the test set generation.
RoleArn *string
// The Amazon S3 storage location for the test set generation.
StorageLocation *types.TestSetStorageLocation
// The unique identifier of the test set generation.
TestSetGenerationId *string
// The status for the test set generation.
TestSetGenerationStatus types.TestSetGenerationStatus
// The unique identifier for the test set created for the generated test set.
TestSetId *string
// The test set name for the generated test set.
TestSetName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTestSetGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTestSetGeneration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTestSetGeneration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTestSetGenerationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTestSetGeneration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTestSetGeneration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DescribeTestSetGeneration",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The pre-signed Amazon S3 URL to download the test execution result artifacts.
func (c *Client) GetTestExecutionArtifactsUrl(ctx context.Context, params *GetTestExecutionArtifactsUrlInput, optFns ...func(*Options)) (*GetTestExecutionArtifactsUrlOutput, error) {
if params == nil {
params = &GetTestExecutionArtifactsUrlInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetTestExecutionArtifactsUrl", params, optFns, c.addOperationGetTestExecutionArtifactsUrlMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetTestExecutionArtifactsUrlOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetTestExecutionArtifactsUrlInput struct {
// The unique identifier of the completed test execution.
//
// This member is required.
TestExecutionId *string
noSmithyDocumentSerde
}
type GetTestExecutionArtifactsUrlOutput struct {
// The pre-signed Amazon S3 URL to download completed test execution.
DownloadArtifactsUrl *string
// The unique identifier of the completed test execution.
TestExecutionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetTestExecutionArtifactsUrlMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTestExecutionArtifactsUrl{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetTestExecutionArtifactsUrlValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTestExecutionArtifactsUrl(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetTestExecutionArtifactsUrl(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetTestExecutionArtifactsUrl",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides a list of utterances that users have sent to the bot. Utterances are
// aggregated by the text of the utterance. For example, all instances where
// customers used the phrase "I want to order pizza" are aggregated into the same
// line in the response. You can see both detected utterances and missed
// utterances. A detected utterance is where the bot properly recognized the
// utterance and activated the associated intent. A missed utterance was not
// recognized by the bot and didn't activate an intent. Utterances can be
// aggregated for a bot alias or for a bot version, but not both at the same time.
// Utterances statistics are not generated under the following conditions:
// - The childDirected field was set to true when the bot was created.
// - You are using slot obfuscation with one or more slots.
// - You opted out of participating in improving Amazon Lex.
func (c *Client) ListAggregatedUtterances(ctx context.Context, params *ListAggregatedUtterancesInput, optFns ...func(*Options)) (*ListAggregatedUtterancesOutput, error) {
if params == nil {
params = &ListAggregatedUtterancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAggregatedUtterances", params, optFns, c.addOperationListAggregatedUtterancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAggregatedUtterancesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAggregatedUtterancesInput struct {
// The time window for aggregating the utterance information. You can specify a
// time between one hour and two weeks.
//
// This member is required.
AggregationDuration *types.UtteranceAggregationDuration
// The unique identifier of the bot associated with this request.
//
// This member is required.
BotId *string
// The identifier of the language and locale where the utterances were collected.
// For more information, see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The identifier of the bot alias associated with this request. If you specify
// the bot alias, you can't specify the bot version.
BotAliasId *string
// The identifier of the bot version associated with this request. If you specify
// the bot version, you can't specify the bot alias.
BotVersion *string
// Provides the specification of a filter used to limit the utterances in the
// response to only those that match the filter specification. You can only specify
// one filter and one string to filter on.
Filters []types.AggregatedUtterancesFilter
// The maximum number of utterances to return in each page of results. If there
// are fewer results than the maximum page size, only the actual number of results
// are returned. If you don't specify the maxResults parameter, 1,000 results are
// returned.
MaxResults *int32
// If the response from the ListAggregatedUtterances operation contains more
// results that specified in the maxResults parameter, a token is returned in the
// response. Use that token in the nextToken parameter to return the next page of
// results.
NextToken *string
// Specifies sorting parameters for the list of utterances. You can sort by the
// hit count, the missed count, or the number of distinct sessions the utterance
// appeared in.
SortBy *types.AggregatedUtterancesSortBy
noSmithyDocumentSerde
}
type ListAggregatedUtterancesOutput struct {
// Summaries of the aggregated utterance data. Each response contains information
// about the number of times that the utterance was seen during the time period,
// whether it was detected or missed, and when it was seen during the time period.
AggregatedUtterancesSummaries []types.AggregatedUtterancesSummary
// The time period used to aggregate the utterance data.
AggregationDuration *types.UtteranceAggregationDuration
// The last date and time that the aggregated data was collected. The time period
// depends on the length of the aggregation window.
// - Hours - for 1 hour time window, every half hour; otherwise every hour.
// - Days - every 6 hours
// - Weeks - for a one week time window, every 12 hours; otherwise, every day
AggregationLastRefreshedDateTime *time.Time
// The date and time that the aggregation window ends. Only data collected between
// the start time and the end time are returned in the results.
AggregationWindowEndTime *time.Time
// The date and time that the aggregation window begins. Only data collected after
// this time is returned in the results.
AggregationWindowStartTime *time.Time
// The identifier of the bot alias that contains the utterances. If you specified
// the bot version, the bot alias ID isn't returned.
BotAliasId *string
// The identifier of the bot that contains the utterances.
BotId *string
// The identifier of the bot version that contains the utterances. If you
// specified the bot alias, the bot version isn't returned.
BotVersion *string
// The identifier of the language and locale that the utterances are in.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListAggregatedUtterances operation. If the nextToken field is present,
// you send the contents as the nextToken parameter of a ListAggregatedUtterances
// operation request to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAggregatedUtterancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAggregatedUtterances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAggregatedUtterances{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAggregatedUtterancesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAggregatedUtterances(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListAggregatedUtterancesAPIClient is a client that implements the
// ListAggregatedUtterances operation.
type ListAggregatedUtterancesAPIClient interface {
ListAggregatedUtterances(context.Context, *ListAggregatedUtterancesInput, ...func(*Options)) (*ListAggregatedUtterancesOutput, error)
}
var _ ListAggregatedUtterancesAPIClient = (*Client)(nil)
// ListAggregatedUtterancesPaginatorOptions is the paginator options for
// ListAggregatedUtterances
type ListAggregatedUtterancesPaginatorOptions struct {
// The maximum number of utterances to return in each page of results. If there
// are fewer results than the maximum page size, only the actual number of results
// are returned. If you don't specify the maxResults parameter, 1,000 results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAggregatedUtterancesPaginator is a paginator for ListAggregatedUtterances
type ListAggregatedUtterancesPaginator struct {
options ListAggregatedUtterancesPaginatorOptions
client ListAggregatedUtterancesAPIClient
params *ListAggregatedUtterancesInput
nextToken *string
firstPage bool
}
// NewListAggregatedUtterancesPaginator returns a new
// ListAggregatedUtterancesPaginator
func NewListAggregatedUtterancesPaginator(client ListAggregatedUtterancesAPIClient, params *ListAggregatedUtterancesInput, optFns ...func(*ListAggregatedUtterancesPaginatorOptions)) *ListAggregatedUtterancesPaginator {
if params == nil {
params = &ListAggregatedUtterancesInput{}
}
options := ListAggregatedUtterancesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAggregatedUtterancesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAggregatedUtterancesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAggregatedUtterances page.
func (p *ListAggregatedUtterancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAggregatedUtterancesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListAggregatedUtterances(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAggregatedUtterances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListAggregatedUtterances",
}
}
| 316 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of aliases for the specified bot.
func (c *Client) ListBotAliases(ctx context.Context, params *ListBotAliasesInput, optFns ...func(*Options)) (*ListBotAliasesOutput, error) {
if params == nil {
params = &ListBotAliasesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBotAliases", params, optFns, c.addOperationListBotAliasesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBotAliasesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBotAliasesInput struct {
// The identifier of the bot to list aliases for.
//
// This member is required.
BotId *string
// The maximum number of aliases to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListBotAliases operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token in the nextToken parameter to return the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListBotAliasesOutput struct {
// Summary information for the bot aliases that meet the filter criteria specified
// in the request. The length of the list is specified in the maxResults parameter
// of the request. If there are more aliases available, the nextToken field
// contains a token to get the next page of results.
BotAliasSummaries []types.BotAliasSummary
// The identifier of the bot associated with the aliases.
BotId *string
// A token that indicates whether there are more results to return in a response
// to the ListBotAliases operation. If the nextToken field is present, you send
// the contents as the nextToken parameter of a ListBotAliases operation request
// to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBotAliasesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBotAliases{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBotAliases{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBotAliasesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBotAliases(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBotAliasesAPIClient is a client that implements the ListBotAliases
// operation.
type ListBotAliasesAPIClient interface {
ListBotAliases(context.Context, *ListBotAliasesInput, ...func(*Options)) (*ListBotAliasesOutput, error)
}
var _ ListBotAliasesAPIClient = (*Client)(nil)
// ListBotAliasesPaginatorOptions is the paginator options for ListBotAliases
type ListBotAliasesPaginatorOptions struct {
// The maximum number of aliases to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBotAliasesPaginator is a paginator for ListBotAliases
type ListBotAliasesPaginator struct {
options ListBotAliasesPaginatorOptions
client ListBotAliasesAPIClient
params *ListBotAliasesInput
nextToken *string
firstPage bool
}
// NewListBotAliasesPaginator returns a new ListBotAliasesPaginator
func NewListBotAliasesPaginator(client ListBotAliasesAPIClient, params *ListBotAliasesInput, optFns ...func(*ListBotAliasesPaginatorOptions)) *ListBotAliasesPaginator {
if params == nil {
params = &ListBotAliasesInput{}
}
options := ListBotAliasesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotAliasesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBotAliasesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBotAliases page.
func (p *ListBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotAliasesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBotAliases(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBotAliases(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBotAliases",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of locales for the specified bot.
func (c *Client) ListBotLocales(ctx context.Context, params *ListBotLocalesInput, optFns ...func(*Options)) (*ListBotLocalesOutput, error) {
if params == nil {
params = &ListBotLocalesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBotLocales", params, optFns, c.addOperationListBotLocalesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBotLocalesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBotLocalesInput struct {
// The identifier of the bot to list locales for.
//
// This member is required.
BotId *string
// The version of the bot to list locales for.
//
// This member is required.
BotVersion *string
// Provides the specification for a filter used to limit the response to only
// those locales that match the filter specification. You can only specify one
// filter and one value to filter on.
Filters []types.BotLocaleFilter
// The maximum number of aliases to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListBotLocales operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token as the nextToken parameter to return the next page of results.
NextToken *string
// Specifies sorting parameters for the list of locales. You can sort by locale
// name in ascending or descending order.
SortBy *types.BotLocaleSortBy
noSmithyDocumentSerde
}
type ListBotLocalesOutput struct {
// The identifier of the bot to list locales for.
BotId *string
// Summary information for the locales that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter of
// the request. If there are more locales available, the nextToken field contains
// a token to get the next page of results.
BotLocaleSummaries []types.BotLocaleSummary
// The version of the bot.
BotVersion *string
// A token that indicates whether there are more results to return in a response
// to the ListBotLocales operation. If the nextToken field is present, you send
// the contents as the nextToken parameter of a ListBotLocales operation request
// to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBotLocalesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBotLocales{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBotLocales{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBotLocalesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBotLocales(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBotLocalesAPIClient is a client that implements the ListBotLocales
// operation.
type ListBotLocalesAPIClient interface {
ListBotLocales(context.Context, *ListBotLocalesInput, ...func(*Options)) (*ListBotLocalesOutput, error)
}
var _ ListBotLocalesAPIClient = (*Client)(nil)
// ListBotLocalesPaginatorOptions is the paginator options for ListBotLocales
type ListBotLocalesPaginatorOptions struct {
// The maximum number of aliases to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBotLocalesPaginator is a paginator for ListBotLocales
type ListBotLocalesPaginator struct {
options ListBotLocalesPaginatorOptions
client ListBotLocalesAPIClient
params *ListBotLocalesInput
nextToken *string
firstPage bool
}
// NewListBotLocalesPaginator returns a new ListBotLocalesPaginator
func NewListBotLocalesPaginator(client ListBotLocalesAPIClient, params *ListBotLocalesInput, optFns ...func(*ListBotLocalesPaginatorOptions)) *ListBotLocalesPaginator {
if params == nil {
params = &ListBotLocalesInput{}
}
options := ListBotLocalesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotLocalesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBotLocalesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBotLocales page.
func (p *ListBotLocalesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotLocalesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBotLocales(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBotLocales(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBotLocales",
}
}
| 257 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get a list of bot recommendations that meet the specified criteria.
func (c *Client) ListBotRecommendations(ctx context.Context, params *ListBotRecommendationsInput, optFns ...func(*Options)) (*ListBotRecommendationsOutput, error) {
if params == nil {
params = &ListBotRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBotRecommendations", params, optFns, c.addOperationListBotRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBotRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBotRecommendationsInput struct {
// The unique identifier of the bot that contains the bot recommendation list.
//
// This member is required.
BotId *string
// The version of the bot that contains the bot recommendation list.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the bot recommendation list.
//
// This member is required.
LocaleId *string
// The maximum number of bot recommendations to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the ListBotRecommendation operation contains more results
// than specified in the maxResults parameter, a token is returned in the response.
// Use that token in the nextToken parameter to return the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListBotRecommendationsOutput struct {
// The unique identifier of the bot that contains the bot recommendation list.
BotId *string
// Summary information for the bot recommendations that meet the filter specified
// in this request. The length of the list is specified in the maxResults parameter
// of the request. If there are more bot recommendations available, the nextToken
// field contains a token to get the next page of results.
BotRecommendationSummaries []types.BotRecommendationSummary
// The version of the bot that contains the bot recommendation list.
BotVersion *string
// The identifier of the language and locale of the bot recommendation list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListBotRecommendations operation. If the nextToken field is present, you
// send the contents as the nextToken parameter of a ListBotRecommendations
// operation request to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBotRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBotRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBotRecommendations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBotRecommendationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBotRecommendations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBotRecommendationsAPIClient is a client that implements the
// ListBotRecommendations operation.
type ListBotRecommendationsAPIClient interface {
ListBotRecommendations(context.Context, *ListBotRecommendationsInput, ...func(*Options)) (*ListBotRecommendationsOutput, error)
}
var _ ListBotRecommendationsAPIClient = (*Client)(nil)
// ListBotRecommendationsPaginatorOptions is the paginator options for
// ListBotRecommendations
type ListBotRecommendationsPaginatorOptions struct {
// The maximum number of bot recommendations to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBotRecommendationsPaginator is a paginator for ListBotRecommendations
type ListBotRecommendationsPaginator struct {
options ListBotRecommendationsPaginatorOptions
client ListBotRecommendationsAPIClient
params *ListBotRecommendationsInput
nextToken *string
firstPage bool
}
// NewListBotRecommendationsPaginator returns a new ListBotRecommendationsPaginator
func NewListBotRecommendationsPaginator(client ListBotRecommendationsAPIClient, params *ListBotRecommendationsInput, optFns ...func(*ListBotRecommendationsPaginatorOptions)) *ListBotRecommendationsPaginator {
if params == nil {
params = &ListBotRecommendationsInput{}
}
options := ListBotRecommendationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBotRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBotRecommendations page.
func (p *ListBotRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotRecommendationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBotRecommendations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBotRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBotRecommendations",
}
}
| 257 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of available bots.
func (c *Client) ListBots(ctx context.Context, params *ListBotsInput, optFns ...func(*Options)) (*ListBotsOutput, error) {
if params == nil {
params = &ListBotsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBots", params, optFns, c.addOperationListBotsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBotsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBotsInput struct {
// Provides the specification of a filter used to limit the bots in the response
// to only those that match the filter specification. You can only specify one
// filter and one string to filter on.
Filters []types.BotFilter
// The maximum number of bots to return in each page of results. If there are
// fewer results than the maximum page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListBots operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// the returned token in the nextToken parameter of a ListBots request to return
// the next page of results. For a complete set of results, call the ListBots
// operation until the nextToken returned in the response is null.
NextToken *string
// Specifies sorting parameters for the list of bots. You can specify that the
// list be sorted by bot name in ascending or descending order.
SortBy *types.BotSortBy
noSmithyDocumentSerde
}
type ListBotsOutput struct {
// Summary information for the bots that meet the filter criteria specified in the
// request. The length of the list is specified in the maxResults parameter of the
// request. If there are more bots available, the nextToken field contains a token
// to the next page of results.
BotSummaries []types.BotSummary
// A token that indicates whether there are more results to return in a response
// to the ListBots operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListBots operation request to get the
// next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBotsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBots{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBots{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBotsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBots(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBotsAPIClient is a client that implements the ListBots operation.
type ListBotsAPIClient interface {
ListBots(context.Context, *ListBotsInput, ...func(*Options)) (*ListBotsOutput, error)
}
var _ ListBotsAPIClient = (*Client)(nil)
// ListBotsPaginatorOptions is the paginator options for ListBots
type ListBotsPaginatorOptions struct {
// The maximum number of bots to return in each page of results. If there are
// fewer results than the maximum page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBotsPaginator is a paginator for ListBots
type ListBotsPaginator struct {
options ListBotsPaginatorOptions
client ListBotsAPIClient
params *ListBotsInput
nextToken *string
firstPage bool
}
// NewListBotsPaginator returns a new ListBotsPaginator
func NewListBotsPaginator(client ListBotsAPIClient, params *ListBotsInput, optFns ...func(*ListBotsPaginatorOptions)) *ListBotsPaginator {
if params == nil {
params = &ListBotsInput{}
}
options := ListBotsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBotsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBots page.
func (p *ListBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBots(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBots(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBots",
}
}
| 242 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about all of the versions of a bot. The ListBotVersions
// operation returns a summary of each version of a bot. For example, if a bot has
// three numbered versions, the ListBotVersions operation returns for summaries,
// one for each numbered version and one for the DRAFT version. The ListBotVersions
// operation always returns at least one version, the DRAFT version.
func (c *Client) ListBotVersions(ctx context.Context, params *ListBotVersionsInput, optFns ...func(*Options)) (*ListBotVersionsOutput, error) {
if params == nil {
params = &ListBotVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBotVersions", params, optFns, c.addOperationListBotVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBotVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBotVersionsInput struct {
// The identifier of the bot to list versions for.
//
// This member is required.
BotId *string
// The maximum number of versions to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response to the ListBotVersion operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token in the nextToken parameter to return the next page of results.
NextToken *string
// Specifies sorting parameters for the list of versions. You can specify that the
// list be sorted by version name in either ascending or descending order.
SortBy *types.BotVersionSortBy
noSmithyDocumentSerde
}
type ListBotVersionsOutput struct {
// The identifier of the bot to list versions for.
BotId *string
// Summary information for the bot versions that meet the filter criteria
// specified in the request. The length of the list is specified in the maxResults
// parameter of the request. If there are more versions available, the nextToken
// field contains a token to get the next page of results.
BotVersionSummaries []types.BotVersionSummary
// A token that indicates whether there are more results to return in a response
// to the ListBotVersions operation. If the nextToken field is present, you send
// the contents as the nextToken parameter of a ListBotAliases operation request
// to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBotVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBotVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBotVersions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBotVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBotVersions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBotVersionsAPIClient is a client that implements the ListBotVersions
// operation.
type ListBotVersionsAPIClient interface {
ListBotVersions(context.Context, *ListBotVersionsInput, ...func(*Options)) (*ListBotVersionsOutput, error)
}
var _ ListBotVersionsAPIClient = (*Client)(nil)
// ListBotVersionsPaginatorOptions is the paginator options for ListBotVersions
type ListBotVersionsPaginatorOptions struct {
// The maximum number of versions to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBotVersionsPaginator is a paginator for ListBotVersions
type ListBotVersionsPaginator struct {
options ListBotVersionsPaginatorOptions
client ListBotVersionsAPIClient
params *ListBotVersionsInput
nextToken *string
firstPage bool
}
// NewListBotVersionsPaginator returns a new ListBotVersionsPaginator
func NewListBotVersionsPaginator(client ListBotVersionsAPIClient, params *ListBotVersionsInput, optFns ...func(*ListBotVersionsPaginatorOptions)) *ListBotVersionsPaginator {
if params == nil {
params = &ListBotVersionsInput{}
}
options := ListBotVersionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBotVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBotVersions page.
func (p *ListBotVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotVersionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBotVersions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBotVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBotVersions",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of built-in intents provided by Amazon Lex that you can use in your
// bot. To use a built-in intent as a the base for your own intent, include the
// built-in intent signature in the parentIntentSignature parameter when you call
// the CreateIntent operation. For more information, see CreateIntent (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateIntent.html)
// .
func (c *Client) ListBuiltInIntents(ctx context.Context, params *ListBuiltInIntentsInput, optFns ...func(*Options)) (*ListBuiltInIntentsOutput, error) {
if params == nil {
params = &ListBuiltInIntentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBuiltInIntents", params, optFns, c.addOperationListBuiltInIntentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBuiltInIntentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBuiltInIntentsInput struct {
// The identifier of the language and locale of the intents to list. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// The maximum number of built-in intents to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the ListBuiltInIntents operation contains more results
// than specified in the maxResults parameter, a token is returned in the
// response. Use that token in the nextToken parameter to return the next page of
// results.
NextToken *string
// Specifies sorting parameters for the list of built-in intents. You can specify
// that the list be sorted by the built-in intent signature in either ascending or
// descending order.
SortBy *types.BuiltInIntentSortBy
noSmithyDocumentSerde
}
type ListBuiltInIntentsOutput struct {
// Summary information for the built-in intents that meet the filter criteria
// specified in the request. The length of the list is specified in the maxResults
// parameter of the request. If there are more intents available, the nextToken
// field contains a token to get the next page of results.
BuiltInIntentSummaries []types.BuiltInIntentSummary
// The language and locale of the intents in the list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListBuiltInIntents operation. If the nextToken field is present, you
// send the contents as the nextToken parameter of a ListBotAliases operation
// request to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBuiltInIntentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBuiltInIntents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBuiltInIntents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBuiltInIntentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBuiltInIntents(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBuiltInIntentsAPIClient is a client that implements the ListBuiltInIntents
// operation.
type ListBuiltInIntentsAPIClient interface {
ListBuiltInIntents(context.Context, *ListBuiltInIntentsInput, ...func(*Options)) (*ListBuiltInIntentsOutput, error)
}
var _ ListBuiltInIntentsAPIClient = (*Client)(nil)
// ListBuiltInIntentsPaginatorOptions is the paginator options for
// ListBuiltInIntents
type ListBuiltInIntentsPaginatorOptions struct {
// The maximum number of built-in intents to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBuiltInIntentsPaginator is a paginator for ListBuiltInIntents
type ListBuiltInIntentsPaginator struct {
options ListBuiltInIntentsPaginatorOptions
client ListBuiltInIntentsAPIClient
params *ListBuiltInIntentsInput
nextToken *string
firstPage bool
}
// NewListBuiltInIntentsPaginator returns a new ListBuiltInIntentsPaginator
func NewListBuiltInIntentsPaginator(client ListBuiltInIntentsAPIClient, params *ListBuiltInIntentsInput, optFns ...func(*ListBuiltInIntentsPaginatorOptions)) *ListBuiltInIntentsPaginator {
if params == nil {
params = &ListBuiltInIntentsInput{}
}
options := ListBuiltInIntentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBuiltInIntentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBuiltInIntentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBuiltInIntents page.
func (p *ListBuiltInIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuiltInIntentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBuiltInIntents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBuiltInIntents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBuiltInIntents",
}
}
| 253 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of built-in slot types that meet the specified criteria.
func (c *Client) ListBuiltInSlotTypes(ctx context.Context, params *ListBuiltInSlotTypesInput, optFns ...func(*Options)) (*ListBuiltInSlotTypesOutput, error) {
if params == nil {
params = &ListBuiltInSlotTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBuiltInSlotTypes", params, optFns, c.addOperationListBuiltInSlotTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBuiltInSlotTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBuiltInSlotTypesInput struct {
// The identifier of the language and locale of the slot types to list. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// The maximum number of built-in slot types to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the ListBuiltInSlotTypes operation contains more results
// than specified in the maxResults parameter, a token is returned in the
// response. Use that token in the nextToken parameter to return the next page of
// results.
NextToken *string
// Determines the sort order for the response from the ListBuiltInSlotTypes
// operation. You can choose to sort by the slot type signature in either ascending
// or descending order.
SortBy *types.BuiltInSlotTypeSortBy
noSmithyDocumentSerde
}
type ListBuiltInSlotTypesOutput struct {
// Summary information for the built-in slot types that meet the filter criteria
// specified in the request. The length of the list is specified in the maxResults
// parameter of the request. If there are more slot types available, the nextToken
// field contains a token to get the next page of results.
BuiltInSlotTypeSummaries []types.BuiltInSlotTypeSummary
// The language and locale of the slot types in the list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListBuiltInSlotTypes operation. If the nextToken field is present, you
// send the contents as the nextToken parameter of a LIstBuiltInSlotTypes
// operation request to get the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBuiltInSlotTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBuiltInSlotTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBuiltInSlotTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBuiltInSlotTypesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBuiltInSlotTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBuiltInSlotTypesAPIClient is a client that implements the
// ListBuiltInSlotTypes operation.
type ListBuiltInSlotTypesAPIClient interface {
ListBuiltInSlotTypes(context.Context, *ListBuiltInSlotTypesInput, ...func(*Options)) (*ListBuiltInSlotTypesOutput, error)
}
var _ ListBuiltInSlotTypesAPIClient = (*Client)(nil)
// ListBuiltInSlotTypesPaginatorOptions is the paginator options for
// ListBuiltInSlotTypes
type ListBuiltInSlotTypesPaginatorOptions struct {
// The maximum number of built-in slot types to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBuiltInSlotTypesPaginator is a paginator for ListBuiltInSlotTypes
type ListBuiltInSlotTypesPaginator struct {
options ListBuiltInSlotTypesPaginatorOptions
client ListBuiltInSlotTypesAPIClient
params *ListBuiltInSlotTypesInput
nextToken *string
firstPage bool
}
// NewListBuiltInSlotTypesPaginator returns a new ListBuiltInSlotTypesPaginator
func NewListBuiltInSlotTypesPaginator(client ListBuiltInSlotTypesAPIClient, params *ListBuiltInSlotTypesInput, optFns ...func(*ListBuiltInSlotTypesPaginatorOptions)) *ListBuiltInSlotTypesPaginator {
if params == nil {
params = &ListBuiltInSlotTypesInput{}
}
options := ListBuiltInSlotTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBuiltInSlotTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBuiltInSlotTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBuiltInSlotTypes page.
func (p *ListBuiltInSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuiltInSlotTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBuiltInSlotTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBuiltInSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListBuiltInSlotTypes",
}
}
| 249 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Paginated list of custom vocabulary items for a given bot locale's custom
// vocabulary.
func (c *Client) ListCustomVocabularyItems(ctx context.Context, params *ListCustomVocabularyItemsInput, optFns ...func(*Options)) (*ListCustomVocabularyItemsOutput, error) {
if params == nil {
params = &ListCustomVocabularyItemsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListCustomVocabularyItems", params, optFns, c.addOperationListCustomVocabularyItemsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListCustomVocabularyItemsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListCustomVocabularyItemsInput struct {
// The identifier of the version of the bot associated with this custom vocabulary.
//
// This member is required.
BotId *string
// The bot version of the bot to the list custom vocabulary request.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported languages
// (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html).
//
// This member is required.
LocaleId *string
// The maximum number of items returned by the list operation.
MaxResults *int32
// The nextToken identifier to the list custom vocabulary request.
NextToken *string
noSmithyDocumentSerde
}
type ListCustomVocabularyItemsOutput struct {
// The identifier of the bot associated with this custom vocabulary.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
BotVersion *string
// The custom vocabulary items from the list custom vocabulary response.
CustomVocabularyItems []types.CustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
LocaleId *string
// The nextToken identifier to the list custom vocabulary response.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListCustomVocabularyItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListCustomVocabularyItems{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCustomVocabularyItems{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListCustomVocabularyItemsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCustomVocabularyItems(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListCustomVocabularyItemsAPIClient is a client that implements the
// ListCustomVocabularyItems operation.
type ListCustomVocabularyItemsAPIClient interface {
ListCustomVocabularyItems(context.Context, *ListCustomVocabularyItemsInput, ...func(*Options)) (*ListCustomVocabularyItemsOutput, error)
}
var _ ListCustomVocabularyItemsAPIClient = (*Client)(nil)
// ListCustomVocabularyItemsPaginatorOptions is the paginator options for
// ListCustomVocabularyItems
type ListCustomVocabularyItemsPaginatorOptions struct {
// The maximum number of items returned by the list operation.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListCustomVocabularyItemsPaginator is a paginator for ListCustomVocabularyItems
type ListCustomVocabularyItemsPaginator struct {
options ListCustomVocabularyItemsPaginatorOptions
client ListCustomVocabularyItemsAPIClient
params *ListCustomVocabularyItemsInput
nextToken *string
firstPage bool
}
// NewListCustomVocabularyItemsPaginator returns a new
// ListCustomVocabularyItemsPaginator
func NewListCustomVocabularyItemsPaginator(client ListCustomVocabularyItemsAPIClient, params *ListCustomVocabularyItemsInput, optFns ...func(*ListCustomVocabularyItemsPaginatorOptions)) *ListCustomVocabularyItemsPaginator {
if params == nil {
params = &ListCustomVocabularyItemsInput{}
}
options := ListCustomVocabularyItemsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListCustomVocabularyItemsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListCustomVocabularyItemsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListCustomVocabularyItems page.
func (p *ListCustomVocabularyItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVocabularyItemsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListCustomVocabularyItems(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListCustomVocabularyItems(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListCustomVocabularyItems",
}
}
| 253 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the exports for a bot, bot locale, or custom vocabulary. Exports are kept
// in the list for 7 days.
func (c *Client) ListExports(ctx context.Context, params *ListExportsInput, optFns ...func(*Options)) (*ListExportsOutput, error) {
if params == nil {
params = &ListExportsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListExports", params, optFns, c.addOperationListExportsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListExportsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListExportsInput struct {
// The unique identifier that Amazon Lex assigned to the bot.
BotId *string
// The version of the bot to list exports for.
BotVersion *string
// Provides the specification of a filter used to limit the exports in the
// response to only those that match the filter specification. You can only specify
// one filter and one string to filter on.
Filters []types.ExportFilter
// Specifies the resources that should be exported. If you don't specify a
// resource type in the filters parameter, both bot locales and custom
// vocabularies are exported.
LocaleId *string
// The maximum number of exports to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListExports operation contains more results that
// specified in the maxResults parameter, a token is returned in the response. Use
// the returned token in the nextToken parameter of a ListExports request to
// return the next page of results. For a complete set of results, call the
// ListExports operation until the nextToken returned in the response is null.
NextToken *string
// Determines the field that the list of exports is sorted by. You can sort by the
// LastUpdatedDateTime field in ascending or descending order.
SortBy *types.ExportSortBy
noSmithyDocumentSerde
}
type ListExportsOutput struct {
// The unique identifier assigned to the bot by Amazon Lex.
BotId *string
// The version of the bot that was exported.
BotVersion *string
// Summary information for the exports that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter.
// If there are more exports available, the nextToken field contains a token to
// get the next page of results.
ExportSummaries []types.ExportSummary
// The locale specified in the request.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListExports operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListExports operation request to get
// the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListExports{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListExports{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListExportsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExports(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListExportsAPIClient is a client that implements the ListExports operation.
type ListExportsAPIClient interface {
ListExports(context.Context, *ListExportsInput, ...func(*Options)) (*ListExportsOutput, error)
}
var _ ListExportsAPIClient = (*Client)(nil)
// ListExportsPaginatorOptions is the paginator options for ListExports
type ListExportsPaginatorOptions struct {
// The maximum number of exports to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListExportsPaginator is a paginator for ListExports
type ListExportsPaginator struct {
options ListExportsPaginatorOptions
client ListExportsAPIClient
params *ListExportsInput
nextToken *string
firstPage bool
}
// NewListExportsPaginator returns a new ListExportsPaginator
func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator {
if params == nil {
params = &ListExportsInput{}
}
options := ListExportsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListExportsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListExportsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListExports page.
func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListExports(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListExports(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListExports",
}
}
| 263 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the imports for a bot, bot locale, or custom vocabulary. Imports are kept
// in the list for 7 days.
func (c *Client) ListImports(ctx context.Context, params *ListImportsInput, optFns ...func(*Options)) (*ListImportsOutput, error) {
if params == nil {
params = &ListImportsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImports", params, optFns, c.addOperationListImportsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImportsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImportsInput struct {
// The unique identifier that Amazon Lex assigned to the bot.
BotId *string
// The version of the bot to list imports for.
BotVersion *string
// Provides the specification of a filter used to limit the bots in the response
// to only those that match the filter specification. You can only specify one
// filter and one string to filter on.
Filters []types.ImportFilter
// Specifies the locale that should be present in the list. If you don't specify a
// resource type in the filters parameter, the list contains both bot locales and
// custom vocabularies.
LocaleId *string
// The maximum number of imports to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListImports operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// the returned token in the nextToken parameter of a ListImports request to
// return the next page of results. For a complete set of results, call the
// ListImports operation until the nextToken returned in the response is null.
NextToken *string
// Determines the field that the list of imports is sorted by. You can sort by the
// LastUpdatedDateTime field in ascending or descending order.
SortBy *types.ImportSortBy
noSmithyDocumentSerde
}
type ListImportsOutput struct {
// The unique identifier assigned by Amazon Lex to the bot.
BotId *string
// The version of the bot that was imported. It will always be DRAFT .
BotVersion *string
// Summary information for the imports that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter.
// If there are more imports available, the nextToken field contains a token to
// get the next page of results.
ImportSummaries []types.ImportSummary
// The locale specified in the request.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListImports operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListImports operation request to get
// the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImports{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImports{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListImportsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImports(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListImportsAPIClient is a client that implements the ListImports operation.
type ListImportsAPIClient interface {
ListImports(context.Context, *ListImportsInput, ...func(*Options)) (*ListImportsOutput, error)
}
var _ ListImportsAPIClient = (*Client)(nil)
// ListImportsPaginatorOptions is the paginator options for ListImports
type ListImportsPaginatorOptions struct {
// The maximum number of imports to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListImportsPaginator is a paginator for ListImports
type ListImportsPaginator struct {
options ListImportsPaginatorOptions
client ListImportsAPIClient
params *ListImportsInput
nextToken *string
firstPage bool
}
// NewListImportsPaginator returns a new ListImportsPaginator
func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator {
if params == nil {
params = &ListImportsInput{}
}
options := ListImportsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImportsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImportsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImports page.
func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListImports(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListImports(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListImports",
}
}
| 263 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get a list of intents that meet the specified criteria.
func (c *Client) ListIntents(ctx context.Context, params *ListIntentsInput, optFns ...func(*Options)) (*ListIntentsOutput, error) {
if params == nil {
params = &ListIntentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListIntents", params, optFns, c.addOperationListIntentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListIntentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListIntentsInput struct {
// The unique identifier of the bot that contains the intent.
//
// This member is required.
BotId *string
// The version of the bot that contains the intent.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the intents to list. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// Provides the specification of a filter used to limit the intents in the
// response to only those that match the filter specification. You can only specify
// one filter and only one string to filter on.
Filters []types.IntentFilter
// The maximum number of intents to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListIntents operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// the returned token in the nextToken parameter of a ListIntents request to
// return the next page of results. For a complete set of results, call the
// ListIntents operation until the nextToken returned in the response is null.
NextToken *string
// Determines the sort order for the response from the ListIntents operation. You
// can choose to sort by the intent name or last updated date in either ascending
// or descending order.
SortBy *types.IntentSortBy
noSmithyDocumentSerde
}
type ListIntentsOutput struct {
// The identifier of the bot that contains the intent.
BotId *string
// The version of the bot that contains the intent.
BotVersion *string
// Summary information for the intents that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter of
// the request. If there are more intents available, the nextToken field contains
// a token to get the next page of results.
IntentSummaries []types.IntentSummary
// The language and locale of the intents in the list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListIntents operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListIntents operation request to get
// the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListIntentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListIntents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIntents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListIntentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIntents(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListIntentsAPIClient is a client that implements the ListIntents operation.
type ListIntentsAPIClient interface {
ListIntents(context.Context, *ListIntentsInput, ...func(*Options)) (*ListIntentsOutput, error)
}
var _ ListIntentsAPIClient = (*Client)(nil)
// ListIntentsPaginatorOptions is the paginator options for ListIntents
type ListIntentsPaginatorOptions struct {
// The maximum number of intents to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListIntentsPaginator is a paginator for ListIntents
type ListIntentsPaginator struct {
options ListIntentsPaginatorOptions
client ListIntentsAPIClient
params *ListIntentsInput
nextToken *string
firstPage bool
}
// NewListIntentsPaginator returns a new ListIntentsPaginator
func NewListIntentsPaginator(client ListIntentsAPIClient, params *ListIntentsInput, optFns ...func(*ListIntentsPaginatorOptions)) *ListIntentsPaginator {
if params == nil {
params = &ListIntentsInput{}
}
options := ListIntentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListIntentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListIntentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListIntents page.
func (p *ListIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIntentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListIntents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListIntents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListIntents",
}
}
| 269 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of recommended intents provided by the bot recommendation that you
// can use in your bot. Intents in the response are ordered by relevance.
func (c *Client) ListRecommendedIntents(ctx context.Context, params *ListRecommendedIntentsInput, optFns ...func(*Options)) (*ListRecommendedIntentsOutput, error) {
if params == nil {
params = &ListRecommendedIntentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRecommendedIntents", params, optFns, c.addOperationListRecommendedIntentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRecommendedIntentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRecommendedIntentsInput struct {
// The unique identifier of the bot associated with the recommended intents.
//
// This member is required.
BotId *string
// The identifier of the bot recommendation that contains the recommended intents.
//
// This member is required.
BotRecommendationId *string
// The version of the bot that contains the recommended intents.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the recommended intents.
//
// This member is required.
LocaleId *string
// The maximum number of bot recommendations to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the ListRecommendedIntents operation contains more results
// than specified in the maxResults parameter, a token is returned in the response.
// Use that token in the nextToken parameter to return the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListRecommendedIntentsOutput struct {
// The unique identifier of the bot associated with the recommended intent.
BotId *string
// The identifier of the bot recommendation that contains the recommended intent.
BotRecommendationId *string
// The version of the bot that contains the intent.
BotVersion *string
// The identifier of the language and locale of the intents to list. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListRecommendedIntents operation. If the nextToken field is present, you
// send the contents as the nextToken parameter of a ListRecommendedIntents
// operation request to get the next page of results.
NextToken *string
// Summary information for the intents that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter of
// the request. If there are more intents available, the nextToken field contains a
// token to get the next page of results.
SummaryList []types.RecommendedIntentSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRecommendedIntentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListRecommendedIntents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRecommendedIntents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListRecommendedIntentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendedIntents(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListRecommendedIntentsAPIClient is a client that implements the
// ListRecommendedIntents operation.
type ListRecommendedIntentsAPIClient interface {
ListRecommendedIntents(context.Context, *ListRecommendedIntentsInput, ...func(*Options)) (*ListRecommendedIntentsOutput, error)
}
var _ ListRecommendedIntentsAPIClient = (*Client)(nil)
// ListRecommendedIntentsPaginatorOptions is the paginator options for
// ListRecommendedIntents
type ListRecommendedIntentsPaginatorOptions struct {
// The maximum number of bot recommendations to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListRecommendedIntentsPaginator is a paginator for ListRecommendedIntents
type ListRecommendedIntentsPaginator struct {
options ListRecommendedIntentsPaginatorOptions
client ListRecommendedIntentsAPIClient
params *ListRecommendedIntentsInput
nextToken *string
firstPage bool
}
// NewListRecommendedIntentsPaginator returns a new ListRecommendedIntentsPaginator
func NewListRecommendedIntentsPaginator(client ListRecommendedIntentsAPIClient, params *ListRecommendedIntentsInput, optFns ...func(*ListRecommendedIntentsPaginatorOptions)) *ListRecommendedIntentsPaginator {
if params == nil {
params = &ListRecommendedIntentsInput{}
}
options := ListRecommendedIntentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListRecommendedIntentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRecommendedIntentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRecommendedIntents page.
func (p *ListRecommendedIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendedIntentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListRecommendedIntents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListRecommendedIntents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListRecommendedIntents",
}
}
| 268 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of slots that match the specified criteria.
func (c *Client) ListSlots(ctx context.Context, params *ListSlotsInput, optFns ...func(*Options)) (*ListSlotsOutput, error) {
if params == nil {
params = &ListSlotsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSlots", params, optFns, c.addOperationListSlotsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSlotsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSlotsInput struct {
// The identifier of the bot that contains the slot.
//
// This member is required.
BotId *string
// The version of the bot that contains the slot.
//
// This member is required.
BotVersion *string
// The unique identifier of the intent that contains the slot.
//
// This member is required.
IntentId *string
// The identifier of the language and locale of the slots to list. The string must
// match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// Provides the specification of a filter used to limit the slots in the response
// to only those that match the filter specification. You can only specify one
// filter and only one string to filter on.
Filters []types.SlotFilter
// The maximum number of slots to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListSlots operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token in the nextToken parameter to return the next page of results.
NextToken *string
// Determines the sort order for the response from the ListSlots operation. You
// can choose to sort by the slot name or last updated date in either ascending or
// descending order.
SortBy *types.SlotSortBy
noSmithyDocumentSerde
}
type ListSlotsOutput struct {
// The identifier of the bot that contains the slots.
BotId *string
// The version of the bot that contains the slots.
BotVersion *string
// The identifier of the intent that contains the slots.
IntentId *string
// The language and locale of the slots in the list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListSlots operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListSlots operation request to get the
// next page of results.
NextToken *string
// Summary information for the slots that meet the filter criteria specified in
// the request. The length of the list is specified in the maxResults parameter of
// the request. If there are more slots available, the nextToken field contains a
// token to get the next page of results.
SlotSummaries []types.SlotSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSlotsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSlots{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSlots{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListSlotsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSlots(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSlotsAPIClient is a client that implements the ListSlots operation.
type ListSlotsAPIClient interface {
ListSlots(context.Context, *ListSlotsInput, ...func(*Options)) (*ListSlotsOutput, error)
}
var _ ListSlotsAPIClient = (*Client)(nil)
// ListSlotsPaginatorOptions is the paginator options for ListSlots
type ListSlotsPaginatorOptions struct {
// The maximum number of slots to return in each page of results. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSlotsPaginator is a paginator for ListSlots
type ListSlotsPaginator struct {
options ListSlotsPaginatorOptions
client ListSlotsAPIClient
params *ListSlotsInput
nextToken *string
firstPage bool
}
// NewListSlotsPaginator returns a new ListSlotsPaginator
func NewListSlotsPaginator(client ListSlotsAPIClient, params *ListSlotsInput, optFns ...func(*ListSlotsPaginatorOptions)) *ListSlotsPaginator {
if params == nil {
params = &ListSlotsInput{}
}
options := ListSlotsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSlotsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSlotsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSlots page.
func (p *ListSlotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSlotsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListSlots(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSlots(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListSlots",
}
}
| 275 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of slot types that match the specified criteria.
func (c *Client) ListSlotTypes(ctx context.Context, params *ListSlotTypesInput, optFns ...func(*Options)) (*ListSlotTypesOutput, error) {
if params == nil {
params = &ListSlotTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSlotTypes", params, optFns, c.addOperationListSlotTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSlotTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSlotTypesInput struct {
// The unique identifier of the bot that contains the slot types.
//
// This member is required.
BotId *string
// The version of the bot that contains the slot type.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the slot types to list. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// Provides the specification of a filter used to limit the slot types in the
// response to only those that match the filter specification. You can only specify
// one filter and only one string to filter on.
Filters []types.SlotTypeFilter
// The maximum number of slot types to return in each page of results. If there
// are fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListSlotTypes operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token in the nextToken parameter to return the next page of results.
NextToken *string
// Determines the sort order for the response from the ListSlotTypes operation.
// You can choose to sort by the slot type name or last updated date in either
// ascending or descending order.
SortBy *types.SlotTypeSortBy
noSmithyDocumentSerde
}
type ListSlotTypesOutput struct {
// The identifier of the bot that contains the slot types.
BotId *string
// The version of the bot that contains the slot types.
BotVersion *string
// The language and local of the slot types in the list.
LocaleId *string
// A token that indicates whether there are more results to return in a response
// to the ListSlotTypes operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListSlotTypes operation request to get
// the next page of results.
NextToken *string
// Summary information for the slot types that meet the filter criteria specified
// in the request. The length of the list is specified in the maxResults parameter
// of the request. If there are more slot types available, the nextToken field
// contains a token to get the next page of results.
SlotTypeSummaries []types.SlotTypeSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSlotTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSlotTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSlotTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListSlotTypesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSlotTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSlotTypesAPIClient is a client that implements the ListSlotTypes operation.
type ListSlotTypesAPIClient interface {
ListSlotTypes(context.Context, *ListSlotTypesInput, ...func(*Options)) (*ListSlotTypesOutput, error)
}
var _ ListSlotTypesAPIClient = (*Client)(nil)
// ListSlotTypesPaginatorOptions is the paginator options for ListSlotTypes
type ListSlotTypesPaginatorOptions struct {
// The maximum number of slot types to return in each page of results. If there
// are fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSlotTypesPaginator is a paginator for ListSlotTypes
type ListSlotTypesPaginator struct {
options ListSlotTypesPaginatorOptions
client ListSlotTypesAPIClient
params *ListSlotTypesInput
nextToken *string
firstPage bool
}
// NewListSlotTypesPaginator returns a new ListSlotTypesPaginator
func NewListSlotTypesPaginator(client ListSlotTypesAPIClient, params *ListSlotTypesInput, optFns ...func(*ListSlotTypesPaginatorOptions)) *ListSlotTypesPaginator {
if params == nil {
params = &ListSlotTypesInput{}
}
options := ListSlotTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSlotTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSlotTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSlotTypes page.
func (p *ListSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSlotTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListSlotTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListSlotTypes",
}
}
| 267 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of tags associated with a resource. Only bots, bot aliases, and bot
// channels can have tags associated with them.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource to get a list of tags for.
//
// This member is required.
ResourceARN *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags associated with a resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListTagsForResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of test execution result items.
func (c *Client) ListTestExecutionResultItems(ctx context.Context, params *ListTestExecutionResultItemsInput, optFns ...func(*Options)) (*ListTestExecutionResultItemsOutput, error) {
if params == nil {
params = &ListTestExecutionResultItemsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTestExecutionResultItems", params, optFns, c.addOperationListTestExecutionResultItemsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTestExecutionResultItemsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTestExecutionResultItemsInput struct {
// The filter for the list of results from the test set execution.
//
// This member is required.
ResultFilterBy *types.TestExecutionResultFilterBy
// The unique identifier of the test execution to list the result items.
//
// This member is required.
TestExecutionId *string
// The maximum number of test execution result items to return in each page. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the ListTestExecutionResultItems operation contains more
// results than specified in the maxResults parameter, a token is returned in the
// response. Use that token in the nextToken parameter to return the next page of
// results.
NextToken *string
noSmithyDocumentSerde
}
type ListTestExecutionResultItemsOutput struct {
// A token that indicates whether there are more results to return in a response
// to the ListTestExecutionResultItems operation. If the nextToken field is
// present, you send the contents as the nextToken parameter of a
// ListTestExecutionResultItems operation request to get the next page of results.
NextToken *string
// The list of results from the test execution.
TestExecutionResults *types.TestExecutionResultItems
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTestExecutionResultItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestExecutionResultItems{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestExecutionResultItems{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTestExecutionResultItemsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTestExecutionResultItems(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTestExecutionResultItemsAPIClient is a client that implements the
// ListTestExecutionResultItems operation.
type ListTestExecutionResultItemsAPIClient interface {
ListTestExecutionResultItems(context.Context, *ListTestExecutionResultItemsInput, ...func(*Options)) (*ListTestExecutionResultItemsOutput, error)
}
var _ ListTestExecutionResultItemsAPIClient = (*Client)(nil)
// ListTestExecutionResultItemsPaginatorOptions is the paginator options for
// ListTestExecutionResultItems
type ListTestExecutionResultItemsPaginatorOptions struct {
// The maximum number of test execution result items to return in each page. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTestExecutionResultItemsPaginator is a paginator for
// ListTestExecutionResultItems
type ListTestExecutionResultItemsPaginator struct {
options ListTestExecutionResultItemsPaginatorOptions
client ListTestExecutionResultItemsAPIClient
params *ListTestExecutionResultItemsInput
nextToken *string
firstPage bool
}
// NewListTestExecutionResultItemsPaginator returns a new
// ListTestExecutionResultItemsPaginator
func NewListTestExecutionResultItemsPaginator(client ListTestExecutionResultItemsAPIClient, params *ListTestExecutionResultItemsInput, optFns ...func(*ListTestExecutionResultItemsPaginatorOptions)) *ListTestExecutionResultItemsPaginator {
if params == nil {
params = &ListTestExecutionResultItemsInput{}
}
options := ListTestExecutionResultItemsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTestExecutionResultItemsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTestExecutionResultItemsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTestExecutionResultItems page.
func (p *ListTestExecutionResultItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestExecutionResultItemsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListTestExecutionResultItems(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTestExecutionResultItems(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListTestExecutionResultItems",
}
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The list of test set executions.
func (c *Client) ListTestExecutions(ctx context.Context, params *ListTestExecutionsInput, optFns ...func(*Options)) (*ListTestExecutionsOutput, error) {
if params == nil {
params = &ListTestExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTestExecutions", params, optFns, c.addOperationListTestExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTestExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTestExecutionsInput struct {
// The maximum number of test executions to return in each page. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
MaxResults *int32
// If the response from the ListTestExecutions operation contains more results
// than specified in the maxResults parameter, a token is returned in the response.
// Use that token in the nextToken parameter to return the next page of results.
NextToken *string
// The sort order of the test set executions.
SortBy *types.TestExecutionSortBy
noSmithyDocumentSerde
}
type ListTestExecutionsOutput struct {
// A token that indicates whether there are more results to return in a response
// to the ListTestExecutions operation. If the nextToken field is present, you send
// the contents as the nextToken parameter of a ListTestExecutions operation
// request to get the next page of results.
NextToken *string
// The list of test executions.
TestExecutions []types.TestExecutionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTestExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTestExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTestExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTestExecutionsAPIClient is a client that implements the ListTestExecutions
// operation.
type ListTestExecutionsAPIClient interface {
ListTestExecutions(context.Context, *ListTestExecutionsInput, ...func(*Options)) (*ListTestExecutionsOutput, error)
}
var _ ListTestExecutionsAPIClient = (*Client)(nil)
// ListTestExecutionsPaginatorOptions is the paginator options for
// ListTestExecutions
type ListTestExecutionsPaginatorOptions struct {
// The maximum number of test executions to return in each page. If there are
// fewer results than the max page size, only the actual number of results are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTestExecutionsPaginator is a paginator for ListTestExecutions
type ListTestExecutionsPaginator struct {
options ListTestExecutionsPaginatorOptions
client ListTestExecutionsAPIClient
params *ListTestExecutionsInput
nextToken *string
firstPage bool
}
// NewListTestExecutionsPaginator returns a new ListTestExecutionsPaginator
func NewListTestExecutionsPaginator(client ListTestExecutionsAPIClient, params *ListTestExecutionsInput, optFns ...func(*ListTestExecutionsPaginatorOptions)) *ListTestExecutionsPaginator {
if params == nil {
params = &ListTestExecutionsInput{}
}
options := ListTestExecutionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTestExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTestExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTestExecutions page.
func (p *ListTestExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestExecutionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListTestExecutions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTestExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListTestExecutions",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The list of test set records.
func (c *Client) ListTestSetRecords(ctx context.Context, params *ListTestSetRecordsInput, optFns ...func(*Options)) (*ListTestSetRecordsOutput, error) {
if params == nil {
params = &ListTestSetRecordsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTestSetRecords", params, optFns, c.addOperationListTestSetRecordsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTestSetRecordsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTestSetRecordsInput struct {
// The identifier of the test set to list its test set records.
//
// This member is required.
TestSetId *string
// The maximum number of test set records to return in each page. If there are
// fewer records than the max page size, only the actual number of records are
// returned.
MaxResults *int32
// If the response from the ListTestSetRecords operation contains more results
// than specified in the maxResults parameter, a token is returned in the response.
// Use that token in the nextToken parameter to return the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListTestSetRecordsOutput struct {
// A token that indicates whether there are more records to return in a response
// to the ListTestSetRecords operation. If the nextToken field is present, you send
// the contents as the nextToken parameter of a ListTestSetRecords operation
// request to get the next page of records.
NextToken *string
// The list of records from the test set.
TestSetRecords []types.TestSetTurnRecord
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTestSetRecordsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestSetRecords{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestSetRecords{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTestSetRecordsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTestSetRecords(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTestSetRecordsAPIClient is a client that implements the ListTestSetRecords
// operation.
type ListTestSetRecordsAPIClient interface {
ListTestSetRecords(context.Context, *ListTestSetRecordsInput, ...func(*Options)) (*ListTestSetRecordsOutput, error)
}
var _ ListTestSetRecordsAPIClient = (*Client)(nil)
// ListTestSetRecordsPaginatorOptions is the paginator options for
// ListTestSetRecords
type ListTestSetRecordsPaginatorOptions struct {
// The maximum number of test set records to return in each page. If there are
// fewer records than the max page size, only the actual number of records are
// returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTestSetRecordsPaginator is a paginator for ListTestSetRecords
type ListTestSetRecordsPaginator struct {
options ListTestSetRecordsPaginatorOptions
client ListTestSetRecordsAPIClient
params *ListTestSetRecordsInput
nextToken *string
firstPage bool
}
// NewListTestSetRecordsPaginator returns a new ListTestSetRecordsPaginator
func NewListTestSetRecordsPaginator(client ListTestSetRecordsAPIClient, params *ListTestSetRecordsInput, optFns ...func(*ListTestSetRecordsPaginatorOptions)) *ListTestSetRecordsPaginator {
if params == nil {
params = &ListTestSetRecordsInput{}
}
options := ListTestSetRecordsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTestSetRecordsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTestSetRecordsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTestSetRecords page.
func (p *ListTestSetRecordsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestSetRecordsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListTestSetRecords(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTestSetRecords(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListTestSetRecords",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The list of the test sets
func (c *Client) ListTestSets(ctx context.Context, params *ListTestSetsInput, optFns ...func(*Options)) (*ListTestSetsOutput, error) {
if params == nil {
params = &ListTestSetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTestSets", params, optFns, c.addOperationListTestSetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTestSetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTestSetsInput struct {
// The maximum number of test sets to return in each page. If there are fewer
// results than the max page size, only the actual number of results are returned.
MaxResults *int32
// If the response from the ListTestSets operation contains more results than
// specified in the maxResults parameter, a token is returned in the response. Use
// that token in the nextToken parameter to return the next page of results.
NextToken *string
// The sort order for the list of test sets.
SortBy *types.TestSetSortBy
noSmithyDocumentSerde
}
type ListTestSetsOutput struct {
// A token that indicates whether there are more results to return in a response
// to the ListTestSets operation. If the nextToken field is present, you send the
// contents as the nextToken parameter of a ListTestSets operation request to get
// the next page of results.
NextToken *string
// The selected test sets in a list of test sets.
TestSets []types.TestSetSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTestSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestSets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestSets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTestSetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTestSets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTestSetsAPIClient is a client that implements the ListTestSets operation.
type ListTestSetsAPIClient interface {
ListTestSets(context.Context, *ListTestSetsInput, ...func(*Options)) (*ListTestSetsOutput, error)
}
var _ ListTestSetsAPIClient = (*Client)(nil)
// ListTestSetsPaginatorOptions is the paginator options for ListTestSets
type ListTestSetsPaginatorOptions struct {
// The maximum number of test sets to return in each page. If there are fewer
// results than the max page size, only the actual number of results are returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTestSetsPaginator is a paginator for ListTestSets
type ListTestSetsPaginator struct {
options ListTestSetsPaginatorOptions
client ListTestSetsAPIClient
params *ListTestSetsInput
nextToken *string
firstPage bool
}
// NewListTestSetsPaginator returns a new ListTestSetsPaginator
func NewListTestSetsPaginator(client ListTestSetsAPIClient, params *ListTestSetsInput, optFns ...func(*ListTestSetsPaginatorOptions)) *ListTestSetsPaginator {
if params == nil {
params = &ListTestSetsInput{}
}
options := ListTestSetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTestSetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTestSetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTestSets page.
func (p *ListTestSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestSetsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListTestSets(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTestSets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "ListTestSets",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Search for associated transcripts that meet the specified criteria.
func (c *Client) SearchAssociatedTranscripts(ctx context.Context, params *SearchAssociatedTranscriptsInput, optFns ...func(*Options)) (*SearchAssociatedTranscriptsOutput, error) {
if params == nil {
params = &SearchAssociatedTranscriptsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchAssociatedTranscripts", params, optFns, c.addOperationSearchAssociatedTranscriptsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchAssociatedTranscriptsOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchAssociatedTranscriptsInput struct {
// The unique identifier of the bot associated with the transcripts that you are
// searching.
//
// This member is required.
BotId *string
// The unique identifier of the bot recommendation associated with the transcripts
// to search.
//
// This member is required.
BotRecommendationId *string
// The version of the bot containing the transcripts that you are searching.
//
// This member is required.
BotVersion *string
// A list of filter objects.
//
// This member is required.
Filters []types.AssociatedTranscriptFilter
// The identifier of the language and locale of the transcripts to search. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
//
// This member is required.
LocaleId *string
// The maximum number of bot recommendations to return in each page of results. If
// there are fewer results than the max page size, only the actual number of
// results are returned.
MaxResults *int32
// If the response from the SearchAssociatedTranscriptsRequest operation contains
// more results than specified in the maxResults parameter, an index is returned in
// the response. Use that index in the nextIndex parameter to return the next page
// of results.
NextIndex *int32
// How SearchResults are ordered. Valid values are Ascending or Descending. The
// default is Descending.
SearchOrder types.SearchOrder
noSmithyDocumentSerde
}
type SearchAssociatedTranscriptsOutput struct {
// The object that contains the associated transcript that meet the criteria you
// specified.
AssociatedTranscripts []types.AssociatedTranscript
// The unique identifier of the bot associated with the transcripts that you are
// searching.
BotId *string
// The unique identifier of the bot recommendation associated with the transcripts
// to search.
BotRecommendationId *string
// The version of the bot containing the transcripts that you are searching.
BotVersion *string
// The identifier of the language and locale of the transcripts to search. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
LocaleId *string
// A index that indicates whether there are more results to return in a response
// to the SearchAssociatedTranscripts operation. If the nextIndex field is present,
// you send the contents as the nextIndex parameter of a
// SearchAssociatedTranscriptsRequest operation to get the next page of results.
NextIndex *int32
// The total number of transcripts returned by the search.
TotalResults *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchAssociatedTranscriptsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchAssociatedTranscripts{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchAssociatedTranscripts{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchAssociatedTranscriptsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchAssociatedTranscripts(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opSearchAssociatedTranscripts(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "SearchAssociatedTranscripts",
}
}
| 190 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Use this to provide your transcript data, and to start the bot recommendation
// process.
func (c *Client) StartBotRecommendation(ctx context.Context, params *StartBotRecommendationInput, optFns ...func(*Options)) (*StartBotRecommendationOutput, error) {
if params == nil {
params = &StartBotRecommendationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartBotRecommendation", params, optFns, c.addOperationStartBotRecommendationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartBotRecommendationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartBotRecommendationInput struct {
// The unique identifier of the bot containing the bot recommendation.
//
// This member is required.
BotId *string
// The version of the bot containing the bot recommendation.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the bot recommendation to start.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
//
// This member is required.
LocaleId *string
// The object representing the Amazon S3 bucket containing the transcript, as well
// as the associated metadata.
//
// This member is required.
TranscriptSourceSetting *types.TranscriptSourceSetting
// The object representing the passwords that will be used to encrypt the data
// related to the bot recommendation results, as well as the KMS key ARN used to
// encrypt the associated metadata.
EncryptionSetting *types.EncryptionSetting
noSmithyDocumentSerde
}
type StartBotRecommendationOutput struct {
// The unique identifier of the bot containing the bot recommendation.
BotId *string
// The identifier of the bot recommendation that you have created.
BotRecommendationId *string
// The status of the bot recommendation. If the status is Failed, then the reasons
// for the failure are listed in the failureReasons field.
BotRecommendationStatus types.BotRecommendationStatus
// The version of the bot containing the bot recommendation.
BotVersion *string
// A timestamp of the date and time that the bot recommendation was created.
CreationDateTime *time.Time
// The object representing the passwords that were used to encrypt the data
// related to the bot recommendation results, as well as the KMS key ARN used to
// encrypt the associated metadata.
EncryptionSetting *types.EncryptionSetting
// The identifier of the language and locale of the bot recommendation to start.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
LocaleId *string
// The object representing the Amazon S3 bucket containing the transcript, as well
// as the associated metadata.
TranscriptSourceSetting *types.TranscriptSourceSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartBotRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartBotRecommendation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartBotRecommendation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartBotRecommendationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartBotRecommendation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartBotRecommendation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartBotRecommendation",
}
}
| 177 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Starts importing a bot, bot locale, or custom vocabulary from a zip archive
// that you uploaded to an S3 bucket.
func (c *Client) StartImport(ctx context.Context, params *StartImportInput, optFns ...func(*Options)) (*StartImportOutput, error) {
if params == nil {
params = &StartImportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartImport", params, optFns, c.addOperationStartImportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartImportOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartImportInput struct {
// The unique identifier for the import. It is included in the response from the
// CreateUploadUrl (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateUploadUrl.html)
// operation.
//
// This member is required.
ImportId *string
// The strategy to use when there is a name conflict between the imported resource
// and an existing resource. When the merge strategy is FailOnConflict existing
// resources are not overwritten and the import fails.
//
// This member is required.
MergeStrategy types.MergeStrategy
// Parameters for creating the bot, bot locale or custom vocabulary.
//
// This member is required.
ResourceSpecification *types.ImportResourceSpecification
// The password used to encrypt the zip archive that contains the resource
// definition. You should always encrypt the zip archive to protect it during
// transit between your site and Amazon Lex.
FilePassword *string
noSmithyDocumentSerde
}
type StartImportOutput struct {
// The date and time that the import request was created.
CreationDateTime *time.Time
// A unique identifier for the import.
ImportId *string
// The current status of the import. When the status is Complete the bot, bot
// alias, or custom vocabulary is ready to use.
ImportStatus types.ImportStatus
// The strategy used when there was a name conflict between the imported resource
// and an existing resource. When the merge strategy is FailOnConflict existing
// resources are not overwritten and the import fails.
MergeStrategy types.MergeStrategy
// The parameters used when importing the resource.
ResourceSpecification *types.ImportResourceSpecification
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartImportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartImport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartImport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartImportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartImport",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The action to start test set execution.
func (c *Client) StartTestExecution(ctx context.Context, params *StartTestExecutionInput, optFns ...func(*Options)) (*StartTestExecutionOutput, error) {
if params == nil {
params = &StartTestExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartTestExecution", params, optFns, c.addOperationStartTestExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartTestExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartTestExecutionInput struct {
// Indicates whether we use streaming or non-streaming APIs for the test set
// execution. For streaming, StartConversation Runtime API is used. Whereas, for
// non-streaming, RecognizeUtterance and RecognizeText Amazon Lex Runtime API are
// used.
//
// This member is required.
ApiMode types.TestExecutionApiMode
// The target bot for the test set execution.
//
// This member is required.
Target *types.TestExecutionTarget
// The test set Id for the test set execution.
//
// This member is required.
TestSetId *string
// Indicates whether audio or text is used.
TestExecutionModality types.TestExecutionModality
noSmithyDocumentSerde
}
type StartTestExecutionOutput struct {
// Indicates whether we use streaming or non-streaming APIs for the test set
// execution. For streaming, StartConversation Amazon Lex Runtime API is used.
// Whereas for non-streaming, RecognizeUtterance and RecognizeText Amazon Lex
// Runtime API are used.
ApiMode types.TestExecutionApiMode
// The creation date and time for the test set execution.
CreationDateTime *time.Time
// The target bot for the test set execution.
Target *types.TestExecutionTarget
// The unique identifier of the test set execution.
TestExecutionId *string
// Indicates whether audio or text is used.
TestExecutionModality types.TestExecutionModality
// The test set Id for the test set execution.
TestSetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartTestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartTestExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartTestExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartTestExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTestExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartTestExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartTestExecution",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The action to start the generation of test set.
func (c *Client) StartTestSetGeneration(ctx context.Context, params *StartTestSetGenerationInput, optFns ...func(*Options)) (*StartTestSetGenerationOutput, error) {
if params == nil {
params = &StartTestSetGenerationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartTestSetGeneration", params, optFns, c.addOperationStartTestSetGenerationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartTestSetGenerationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartTestSetGenerationInput struct {
// The data source for the test set generation.
//
// This member is required.
GenerationDataSource *types.TestSetGenerationDataSource
// The roleARN used for any operation in the test set to access resources in the
// Amazon Web Services account.
//
// This member is required.
RoleArn *string
// The Amazon S3 storage location for the test set generation.
//
// This member is required.
StorageLocation *types.TestSetStorageLocation
// The test set name for the test set generation request.
//
// This member is required.
TestSetName *string
// The test set description for the test set generation request.
Description *string
// A list of tags to add to the test set. You can only add tags when you
// import/generate a new test set. You can't use the UpdateTestSet operation to
// update tags. To update tags, use the TagResource operation.
TestSetTags map[string]string
noSmithyDocumentSerde
}
type StartTestSetGenerationOutput struct {
// The creation date and time for the test set generation.
CreationDateTime *time.Time
// The description used for the test set generation.
Description *string
// The data source for the test set generation.
GenerationDataSource *types.TestSetGenerationDataSource
// The roleARN used for any operation in the test set to access resources in the
// Amazon Web Services account.
RoleArn *string
// The Amazon S3 storage location for the test set generation.
StorageLocation *types.TestSetStorageLocation
// The unique identifier of the test set generation to describe.
TestSetGenerationId *string
// The status for the test set generation.
TestSetGenerationStatus types.TestSetGenerationStatus
// The test set name used for the test set generation.
TestSetName *string
// A list of tags that was used for the test set that is being generated.
TestSetTags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartTestSetGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartTestSetGeneration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartTestSetGeneration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartTestSetGenerationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTestSetGeneration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartTestSetGeneration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartTestSetGeneration",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Stop an already running Bot Recommendation request.
func (c *Client) StopBotRecommendation(ctx context.Context, params *StopBotRecommendationInput, optFns ...func(*Options)) (*StopBotRecommendationOutput, error) {
if params == nil {
params = &StopBotRecommendationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopBotRecommendation", params, optFns, c.addOperationStopBotRecommendationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopBotRecommendationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopBotRecommendationInput struct {
// The unique identifier of the bot containing the bot recommendation to be
// stopped.
//
// This member is required.
BotId *string
// The unique identifier of the bot recommendation to be stopped.
//
// This member is required.
BotRecommendationId *string
// The version of the bot containing the bot recommendation.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale of the bot recommendation to stop.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type StopBotRecommendationOutput struct {
// The unique identifier of the bot containing the bot recommendation that is
// being stopped.
BotId *string
// The unique identifier of the bot recommendation that is being stopped.
BotRecommendationId *string
// The status of the bot recommendation. If the status is Failed, then the reasons
// for the failure are listed in the failureReasons field.
BotRecommendationStatus types.BotRecommendationStatus
// The version of the bot containing the recommendation that is being stopped.
BotVersion *string
// The identifier of the language and locale of the bot response to stop. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
LocaleId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopBotRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStopBotRecommendation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopBotRecommendation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopBotRecommendationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopBotRecommendation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStopBotRecommendation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StopBotRecommendation",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds the specified tags to the specified resource. If a tag key already exists,
// the existing value is replaced with the new value.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the bot, bot alias, or bot channel to tag.
//
// This member is required.
ResourceARN *string
// A list of tag keys to add to the resource. If a tag key already exists, the
// existing value is replaced with the new value.
//
// This member is required.
Tags map[string]string
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "TagResource",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes tags from a bot, bot alias, or bot channel.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource to remove the tags from.
//
// This member is required.
ResourceARN *string
// A list of tag keys to remove from the resource. If a tag key does not exist on
// the resource, it is ignored.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UntagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the configuration of an existing bot.
func (c *Client) UpdateBot(ctx context.Context, params *UpdateBotInput, optFns ...func(*Options)) (*UpdateBotOutput, error) {
if params == nil {
params = &UpdateBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBot", params, optFns, c.addOperationUpdateBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateBotInput struct {
// The unique identifier of the bot to update. This identifier is returned by the
// CreateBot (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html)
// operation.
//
// This member is required.
BotId *string
// The new name of the bot. The name must be unique in the account that creates
// the bot.
//
// This member is required.
BotName *string
// Provides information on additional privacy protections Amazon Lex should use
// with the bot's data.
//
// This member is required.
DataPrivacy *types.DataPrivacy
// The time, in seconds, that Amazon Lex should keep information about a user's
// conversation with the bot. A user interaction remains active for the amount of
// time specified. If no conversation occurs during this time, the session expires
// and Amazon Lex deletes any data provided before the timeout. You can specify
// between 60 (1 minute) and 86,400 (24 hours) seconds.
//
// This member is required.
IdleSessionTTLInSeconds *int32
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the bot.
//
// This member is required.
RoleArn *string
// The list of bot members in the network associated with the update action.
BotMembers []types.BotMember
// The type of the bot to be updated.
BotType types.BotType
// A description of the bot.
Description *string
noSmithyDocumentSerde
}
type UpdateBotOutput struct {
// The unique identifier of the bot that was updated.
BotId *string
// The list of bot members in the network that was updated.
BotMembers []types.BotMember
// The name of the bot after the update.
BotName *string
// Shows the current status of the bot. The bot is first in the Creating status.
// Once the bot is read for use, it changes to the Available status. After the bot
// is created, you can use the DRAFT version of the bot.
BotStatus types.BotStatus
// The type of the bot that was updated.
BotType types.BotType
// A timestamp of the date and time that the bot was created.
CreationDateTime *time.Time
// The data privacy settings for the bot after the update.
DataPrivacy *types.DataPrivacy
// The description of the bot after the update.
Description *string
// The session timeout, in seconds, for the bot after the update.
IdleSessionTTLInSeconds *int32
// A timestamp of the date and time that the bot was last updated.
LastUpdatedDateTime *time.Time
// The Amazon Resource Name (ARN) of the IAM role used by the bot after the update.
RoleArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateBot",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the configuration of an existing bot alias.
func (c *Client) UpdateBotAlias(ctx context.Context, params *UpdateBotAliasInput, optFns ...func(*Options)) (*UpdateBotAliasOutput, error) {
if params == nil {
params = &UpdateBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBotAlias", params, optFns, c.addOperationUpdateBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateBotAliasInput struct {
// The unique identifier of the bot alias.
//
// This member is required.
BotAliasId *string
// The new name to assign to the bot alias.
//
// This member is required.
BotAliasName *string
// The identifier of the bot with the updated alias.
//
// This member is required.
BotId *string
// The new Lambda functions to use in each locale for the bot alias.
BotAliasLocaleSettings map[string]types.BotAliasLocaleSettings
// The new bot version to assign to the bot alias.
BotVersion *string
// The new settings for storing conversation logs in Amazon CloudWatch Logs and
// Amazon S3 buckets.
ConversationLogSettings *types.ConversationLogSettings
// The new description to assign to the bot alias.
Description *string
// Determines whether Amazon Lex will use Amazon Comprehend to detect the
// sentiment of user utterances.
SentimentAnalysisSettings *types.SentimentAnalysisSettings
noSmithyDocumentSerde
}
type UpdateBotAliasOutput struct {
// The identifier of the updated bot alias.
BotAliasId *string
// The updated Lambda functions to use in each locale for the bot alias.
BotAliasLocaleSettings map[string]types.BotAliasLocaleSettings
// The updated name of the bot alias.
BotAliasName *string
// The current status of the bot alias. When the status is Available the alias is
// ready for use.
BotAliasStatus types.BotAliasStatus
// The identifier of the bot with the updated alias.
BotId *string
// The updated version of the bot that the alias points to.
BotVersion *string
// The updated settings for storing conversation logs in Amazon CloudWatch Logs
// and Amazon S3 buckets.
ConversationLogSettings *types.ConversationLogSettings
// A timestamp of the date and time that the bot was created.
CreationDateTime *time.Time
// The updated description of the bot alias.
Description *string
// A timestamp of the date and time that the bot was last updated.
LastUpdatedDateTime *time.Time
// Determines whether Amazon Lex will use Amazon Comprehend to detect the
// sentiment of user utterances.
SentimentAnalysisSettings *types.SentimentAnalysisSettings
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBotAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBotAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateBotAlias",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the settings that a bot has for a specific locale.
func (c *Client) UpdateBotLocale(ctx context.Context, params *UpdateBotLocaleInput, optFns ...func(*Options)) (*UpdateBotLocaleOutput, error) {
if params == nil {
params = &UpdateBotLocaleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBotLocale", params, optFns, c.addOperationUpdateBotLocaleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBotLocaleOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateBotLocaleInput struct {
// The unique identifier of the bot that contains the locale.
//
// This member is required.
BotId *string
// The version of the bot that contains the locale to be updated. The version can
// only be the DRAFT version.
//
// This member is required.
BotVersion *string
// The identifier of the language and locale to update. The string must match one
// of the supported locales. For more information, see Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The new confidence threshold where Amazon Lex inserts the AMAZON.FallbackIntent
// and AMAZON.KendraSearchIntent intents in the list of possible intents for an
// utterance.
//
// This member is required.
NluIntentConfidenceThreshold *float64
// The new description of the locale.
Description *string
// The new Amazon Polly voice Amazon Lex should use for voice interaction with the
// user.
VoiceSettings *types.VoiceSettings
noSmithyDocumentSerde
}
type UpdateBotLocaleOutput struct {
// The identifier of the bot that contains the updated locale.
BotId *string
// The current status of the locale. When the bot status is Built the locale is
// ready for use.
BotLocaleStatus types.BotLocaleStatus
// The version of the bot that contains the updated locale.
BotVersion *string
// A timestamp of the date and time that the locale was created.
CreationDateTime *time.Time
// The updated description of the locale.
Description *string
// If the botLocaleStatus is Failed , the failureReasons field lists the errors
// that occurred while building the bot.
FailureReasons []string
// A timestamp of the date and time that the locale was last updated.
LastUpdatedDateTime *time.Time
// The language and locale of the updated bot locale.
LocaleId *string
// The updated locale name for the locale.
LocaleName *string
// The updated confidence threshold for inserting the AMAZON.FallbackIntent and
// AMAZON.KendraSearchIntent intents in the list of possible intents for an
// utterance.
NluIntentConfidenceThreshold *float64
// Recommended actions to take to resolve an error in the failureReasons field.
RecommendedActions []string
// The updated Amazon Polly voice to use for voice interaction with the user.
VoiceSettings *types.VoiceSettings
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBotLocaleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBotLocale{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBotLocale{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBotLocaleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBotLocale(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBotLocale(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateBotLocale",
}
}
| 190 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an existing bot recommendation request.
func (c *Client) UpdateBotRecommendation(ctx context.Context, params *UpdateBotRecommendationInput, optFns ...func(*Options)) (*UpdateBotRecommendationOutput, error) {
if params == nil {
params = &UpdateBotRecommendationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBotRecommendation", params, optFns, c.addOperationUpdateBotRecommendationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBotRecommendationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateBotRecommendationInput struct {
// The unique identifier of the bot containing the bot recommendation to be
// updated.
//
// This member is required.
BotId *string
// The unique identifier of the bot recommendation to be updated.
//
// This member is required.
BotRecommendationId *string
// The version of the bot containing the bot recommendation to be updated.
//
// This member is required.
BotVersion *string
// The object representing the passwords that will be used to encrypt the data
// related to the bot recommendation results, as well as the KMS key ARN used to
// encrypt the associated metadata.
//
// This member is required.
EncryptionSetting *types.EncryptionSetting
// The identifier of the language and locale of the bot recommendation to update.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type UpdateBotRecommendationOutput struct {
// The unique identifier of the bot containing the bot recommendation that has
// been updated.
BotId *string
// The unique identifier of the bot recommendation to be updated.
BotRecommendationId *string
// The status of the bot recommendation. If the status is Failed, then the reasons
// for the failure are listed in the failureReasons field.
BotRecommendationStatus types.BotRecommendationStatus
// The version of the bot containing the bot recommendation that has been updated.
BotVersion *string
// A timestamp of the date and time that the bot recommendation was created.
CreationDateTime *time.Time
// The object representing the passwords that were used to encrypt the data
// related to the bot recommendation results, as well as the KMS key ARN used to
// encrypt the associated metadata.
EncryptionSetting *types.EncryptionSetting
// A timestamp of the date and time that the bot recommendation was last updated.
LastUpdatedDateTime *time.Time
// The identifier of the language and locale of the bot recommendation to update.
// The string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
LocaleId *string
// The object representing the Amazon S3 bucket containing the transcript, as well
// as the associated metadata.
TranscriptSourceSetting *types.TranscriptSourceSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBotRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBotRecommendation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBotRecommendation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBotRecommendationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBotRecommendation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBotRecommendation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateBotRecommendation",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the password used to protect an export zip archive. The password is not
// required. If you don't supply a password, Amazon Lex generates a zip file that
// is not protected by a password. This is the archive that is available at the
// pre-signed S3 URL provided by the DescribeExport (https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html)
// operation.
func (c *Client) UpdateExport(ctx context.Context, params *UpdateExportInput, optFns ...func(*Options)) (*UpdateExportOutput, error) {
if params == nil {
params = &UpdateExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateExport", params, optFns, c.addOperationUpdateExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateExportInput struct {
// The unique identifier Amazon Lex assigned to the export.
//
// This member is required.
ExportId *string
// The new password to use to encrypt the export zip archive.
FilePassword *string
noSmithyDocumentSerde
}
type UpdateExportOutput struct {
// The date and time that the export was created.
CreationDateTime *time.Time
// The unique identifier Amazon Lex assigned to the export.
ExportId *string
// The status of the export. When the status is Completed the export archive is
// available for download.
ExportStatus types.ExportStatus
// The file format used for the files that define the resource. The TSV format is
// required to export a custom vocabulary only; otherwise use LexJson format.
FileFormat types.ImportExportFileFormat
// The date and time that the export was last updated.
LastUpdatedDateTime *time.Time
// A description of the type of resource that was exported, either a bot or a bot
// locale.
ResourceSpecification *types.ExportResourceSpecification
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateExport(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateExport",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the settings for an intent.
func (c *Client) UpdateIntent(ctx context.Context, params *UpdateIntentInput, optFns ...func(*Options)) (*UpdateIntentOutput, error) {
if params == nil {
params = &UpdateIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateIntent", params, optFns, c.addOperationUpdateIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateIntentInput struct {
// The identifier of the bot that contains the intent.
//
// This member is required.
BotId *string
// The version of the bot that contains the intent. Must be DRAFT .
//
// This member is required.
BotVersion *string
// The unique identifier of the intent to update.
//
// This member is required.
IntentId *string
// The new name for the intent.
//
// This member is required.
IntentName *string
// The identifier of the language and locale where this intent is used. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// The new description of the intent.
Description *string
// The new Lambda function to use between each turn of the conversation with the
// bot.
DialogCodeHook *types.DialogCodeHookSettings
// The new Lambda function to call when all of the intents required slots are
// provided and the intent is ready for fulfillment.
FulfillmentCodeHook *types.FulfillmentCodeHookSettings
// Configuration settings for a response sent to the user before Amazon Lex starts
// eliciting slots.
InitialResponseSetting *types.InitialResponseSetting
// A new list of contexts that must be active in order for Amazon Lex to consider
// the intent.
InputContexts []types.InputContext
// The new response that Amazon Lex sends the user when the intent is closed.
IntentClosingSetting *types.IntentClosingSetting
// New prompts that Amazon Lex sends to the user to confirm the completion of an
// intent.
IntentConfirmationSetting *types.IntentConfirmationSetting
// New configuration settings for connecting to an Amazon Kendra index.
KendraConfiguration *types.KendraConfiguration
// A new list of contexts that Amazon Lex activates when the intent is fulfilled.
OutputContexts []types.OutputContext
// The signature of the new built-in intent to use as the parent of this intent.
ParentIntentSignature *string
// New utterances used to invoke the intent.
SampleUtterances []types.SampleUtterance
// A new list of slots and their priorities that are contained by the intent.
SlotPriorities []types.SlotPriority
noSmithyDocumentSerde
}
type UpdateIntentOutput struct {
// The identifier of the bot that contains the intent.
BotId *string
// The version of the bot that contains the intent. Will always be DRAFT .
BotVersion *string
// A timestamp of when the intent was created.
CreationDateTime *time.Time
// The updated description of the intent.
Description *string
// The updated Lambda function called during each turn of the conversation with
// the user.
DialogCodeHook *types.DialogCodeHookSettings
// The updated Lambda function called when the intent is ready for fulfillment.
FulfillmentCodeHook *types.FulfillmentCodeHookSettings
// Configuration settings for a response sent to the user before Amazon Lex starts
// eliciting slots.
InitialResponseSetting *types.InitialResponseSetting
// The updated list of contexts that must be active for the intent to be
// considered by Amazon Lex.
InputContexts []types.InputContext
// The updated response that Amazon Lex sends the user when the intent is closed.
IntentClosingSetting *types.IntentClosingSetting
// The updated prompts that Amazon Lex sends to the user to confirm the completion
// of an intent.
IntentConfirmationSetting *types.IntentConfirmationSetting
// The identifier of the intent that was updated.
IntentId *string
// The updated name of the intent.
IntentName *string
// The updated configuration for connecting to an Amazon Kendra index with the
// AMAZON.KendraSearchIntent intent.
KendraConfiguration *types.KendraConfiguration
// A timestamp of the last time that the intent was modified.
LastUpdatedDateTime *time.Time
// The updated language and locale of the intent.
LocaleId *string
// The updated list of contexts that Amazon Lex activates when the intent is
// fulfilled.
OutputContexts []types.OutputContext
// The updated built-in intent that is the parent of this intent.
ParentIntentSignature *string
// The updated list of sample utterances for the intent.
SampleUtterances []types.SampleUtterance
// The updated list of slots and their priorities that are elicited from the user
// for the intent.
SlotPriorities []types.SlotPriority
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIntent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIntent(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateIntent",
}
}
| 250 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Replaces the existing resource policy for a bot or bot alias with a new one. If
// the policy doesn't exist, Amazon Lex returns an exception.
func (c *Client) UpdateResourcePolicy(ctx context.Context, params *UpdateResourcePolicyInput, optFns ...func(*Options)) (*UpdateResourcePolicyOutput, error) {
if params == nil {
params = &UpdateResourcePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateResourcePolicy", params, optFns, c.addOperationUpdateResourcePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateResourcePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateResourcePolicyInput struct {
// A resource policy to add to the resource. The policy is a JSON structure that
// contains one or more statements that define the policy. The policy must follow
// the IAM syntax. For more information about the contents of a JSON policy
// document, see IAM JSON policy reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)
// . If the policy isn't valid, Amazon Lex returns a validation exception.
//
// This member is required.
Policy *string
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
//
// This member is required.
ResourceArn *string
// The identifier of the revision of the policy to update. If this revision ID
// doesn't match the current revision ID, Amazon Lex throws an exception. If you
// don't specify a revision, Amazon Lex overwrites the contents of the policy with
// the new values.
ExpectedRevisionId *string
noSmithyDocumentSerde
}
type UpdateResourcePolicyOutput struct {
// The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy
// is attached to.
ResourceArn *string
// The current revision of the resource policy. Use the revision ID to make sure
// that you are updating the most current version of a resource policy when you add
// a policy statement to a resource, delete a resource, or update a resource.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateResourcePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateResourcePolicy",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the settings for a slot.
func (c *Client) UpdateSlot(ctx context.Context, params *UpdateSlotInput, optFns ...func(*Options)) (*UpdateSlotOutput, error) {
if params == nil {
params = &UpdateSlotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSlot", params, optFns, c.addOperationUpdateSlotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSlotOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSlotInput struct {
// The unique identifier of the bot that contains the slot.
//
// This member is required.
BotId *string
// The version of the bot that contains the slot. Must always be DRAFT .
//
// This member is required.
BotVersion *string
// The identifier of the intent that contains the slot.
//
// This member is required.
IntentId *string
// The identifier of the language and locale that contains the slot. The string
// must match one of the supported locales. For more information, see Supported
// languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html) .
//
// This member is required.
LocaleId *string
// The unique identifier for the slot to update.
//
// This member is required.
SlotId *string
// The new name for the slot.
//
// This member is required.
SlotName *string
// A new set of prompts that Amazon Lex sends to the user to elicit a response the
// provides a value for the slot.
//
// This member is required.
ValueElicitationSetting *types.SlotValueElicitationSetting
// The new description for the slot.
Description *string
// Determines whether the slot accepts multiple values in one response. Multiple
// value slots are only available in the en-US locale. If you set this value to
// true in any other locale, Amazon Lex throws a ValidationException . If the
// multipleValuesSetting is not set, the default value is false .
MultipleValuesSetting *types.MultipleValuesSetting
// New settings that determine how slot values are formatted in Amazon CloudWatch
// logs.
ObfuscationSetting *types.ObfuscationSetting
// The unique identifier of the new slot type to associate with this slot.
SlotTypeId *string
// Specifications for the constituent sub slots and the expression for the
// composite slot.
SubSlotSetting *types.SubSlotSetting
noSmithyDocumentSerde
}
type UpdateSlotOutput struct {
// The identifier of the bot that contains the slot.
BotId *string
// The version of the bot that contains the slot. Will always be DRAFT .
BotVersion *string
// The timestamp of the date and time that the slot was created.
CreationDateTime *time.Time
// The updated description of the bot.
Description *string
// The intent that contains the slot.
IntentId *string
// The timestamp of the date and time that the slot was last updated.
LastUpdatedDateTime *time.Time
// The locale that contains the slot.
LocaleId *string
// Indicates whether the slot accepts multiple values in one response.
MultipleValuesSetting *types.MultipleValuesSetting
// The updated setting that determines whether the slot value is obfuscated in the
// Amazon CloudWatch logs.
ObfuscationSetting *types.ObfuscationSetting
// The unique identifier of the slot that was updated.
SlotId *string
// The updated name of the slot.
SlotName *string
// The updated identifier of the slot type that provides values for the slot.
SlotTypeId *string
// Specifications for the constituent sub slots and the expression for the
// composite slot.
SubSlotSetting *types.SubSlotSetting
// The updated prompts that Amazon Lex sends to the user to elicit a response that
// provides a value for the slot.
ValueElicitationSetting *types.SlotValueElicitationSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSlotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSlot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSlot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSlotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSlot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSlot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateSlot",
}
}
| 221 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the configuration of an existing slot type.
func (c *Client) UpdateSlotType(ctx context.Context, params *UpdateSlotTypeInput, optFns ...func(*Options)) (*UpdateSlotTypeOutput, error) {
if params == nil {
params = &UpdateSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSlotType", params, optFns, c.addOperationUpdateSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSlotTypeInput struct {
// The identifier of the bot that contains the slot type.
//
// This member is required.
BotId *string
// The version of the bot that contains the slot type. Must be DRAFT .
//
// This member is required.
BotVersion *string
// The identifier of the language and locale that contains the slot type. The
// string must match one of the supported locales. For more information, see
// Supported languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
// The unique identifier of the slot type to update.
//
// This member is required.
SlotTypeId *string
// The new name of the slot type.
//
// This member is required.
SlotTypeName *string
// Specifications for a composite slot type.
CompositeSlotTypeSetting *types.CompositeSlotTypeSetting
// The new description of the slot type.
Description *string
// Provides information about the external source of the slot type's definition.
ExternalSourceSetting *types.ExternalSourceSetting
// The new built-in slot type that should be used as the parent of this slot type.
ParentSlotTypeSignature *string
// A new list of values and their optional synonyms that define the values that
// the slot type can take.
SlotTypeValues []types.SlotTypeValue
// The strategy that Amazon Lex should use when deciding on a value from the list
// of slot type values.
ValueSelectionSetting *types.SlotValueSelectionSetting
noSmithyDocumentSerde
}
type UpdateSlotTypeOutput struct {
// The identifier of the bot that contains the slot type.
BotId *string
// The version of the bot that contains the slot type. This is always DRAFT .
BotVersion *string
// Specifications for a composite slot type.
CompositeSlotTypeSetting *types.CompositeSlotTypeSetting
// The timestamp of the date and time that the slot type was created.
CreationDateTime *time.Time
// The updated description of the slot type.
Description *string
// Provides information about the external source of the slot type's definition.
ExternalSourceSetting *types.ExternalSourceSetting
// A timestamp of the date and time that the slot type was last updated.
LastUpdatedDateTime *time.Time
// The language and locale of the updated slot type.
LocaleId *string
// The updated signature of the built-in slot type that is the parent of this slot
// type.
ParentSlotTypeSignature *string
// The unique identifier of the updated slot type.
SlotTypeId *string
// The updated name of the slot type.
SlotTypeName *string
// The updated values that the slot type provides.
SlotTypeValues []types.SlotTypeValue
// The updated strategy that Amazon Lex uses to determine which value to select
// from the slot type.
ValueSelectionSetting *types.SlotValueSelectionSetting
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSlotType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSlotType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateSlotType",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The action to update the test set.
func (c *Client) UpdateTestSet(ctx context.Context, params *UpdateTestSetInput, optFns ...func(*Options)) (*UpdateTestSetOutput, error) {
if params == nil {
params = &UpdateTestSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateTestSet", params, optFns, c.addOperationUpdateTestSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateTestSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateTestSetInput struct {
// The test set Id for which update test operation to be performed.
//
// This member is required.
TestSetId *string
// The new test set name.
//
// This member is required.
TestSetName *string
// The new test set description.
Description *string
noSmithyDocumentSerde
}
type UpdateTestSetOutput struct {
// The creation date and time for the updated test set.
CreationDateTime *time.Time
// The test set description for the updated test set.
Description *string
// The date and time of the last update for the updated test set.
LastUpdatedDateTime *time.Time
// Indicates whether audio or text is used for the updated test set.
Modality types.TestSetModality
// The number of conversation turns from the updated test set.
NumTurns *int32
// The roleARN used for any operation in the test set to access resources in the
// Amazon Web Services account.
RoleArn *string
// The status for the updated test set.
Status types.TestSetStatus
// The Amazon S3 storage location for the updated test set.
StorageLocation *types.TestSetStorageLocation
// The test set Id for which update test operation to be performed.
TestSetId *string
// The test set name for the updated test set.
TestSetName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateTestSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTestSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTestSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateTestSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTestSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateTestSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "UpdateTestSet",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lexmodelsv2 provides the API client, operations, and parameter types
// for Amazon Lex Model Building V2.
package lexmodelsv2
| 6 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "lex"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package lexmodelsv2
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.29.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
)
type awsRestjson1_serializeOpBatchCreateCustomVocabularyItem struct {
}
func (*awsRestjson1_serializeOpBatchCreateCustomVocabularyItem) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchCreateCustomVocabularyItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchCreateCustomVocabularyItemInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary/DEFAULT/batchcreate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchCreateCustomVocabularyItemInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchCreateCustomVocabularyItemInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsBatchCreateCustomVocabularyItemInput(v *BatchCreateCustomVocabularyItemInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchCreateCustomVocabularyItemInput(v *BatchCreateCustomVocabularyItemInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomVocabularyItemList != nil {
ok := object.Key("customVocabularyItemList")
if err := awsRestjson1_serializeDocumentCreateCustomVocabularyItemsList(v.CustomVocabularyItemList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchDeleteCustomVocabularyItem struct {
}
func (*awsRestjson1_serializeOpBatchDeleteCustomVocabularyItem) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchDeleteCustomVocabularyItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchDeleteCustomVocabularyItemInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary/DEFAULT/batchdelete")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchDeleteCustomVocabularyItemInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchDeleteCustomVocabularyItemInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsBatchDeleteCustomVocabularyItemInput(v *BatchDeleteCustomVocabularyItemInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchDeleteCustomVocabularyItemInput(v *BatchDeleteCustomVocabularyItemInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomVocabularyItemList != nil {
ok := object.Key("customVocabularyItemList")
if err := awsRestjson1_serializeDocumentDeleteCustomVocabularyItemsList(v.CustomVocabularyItemList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchUpdateCustomVocabularyItem struct {
}
func (*awsRestjson1_serializeOpBatchUpdateCustomVocabularyItem) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchUpdateCustomVocabularyItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchUpdateCustomVocabularyItemInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary/DEFAULT/batchupdate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchUpdateCustomVocabularyItemInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchUpdateCustomVocabularyItemInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsBatchUpdateCustomVocabularyItemInput(v *BatchUpdateCustomVocabularyItemInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchUpdateCustomVocabularyItemInput(v *BatchUpdateCustomVocabularyItemInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomVocabularyItemList != nil {
ok := object.Key("customVocabularyItemList")
if err := awsRestjson1_serializeDocumentUpdateCustomVocabularyItemsList(v.CustomVocabularyItemList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBuildBotLocale struct {
}
func (*awsRestjson1_serializeOpBuildBotLocale) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBuildBotLocale) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BuildBotLocaleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBuildBotLocaleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsBuildBotLocaleInput(v *BuildBotLocaleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateBot struct {
}
func (*awsRestjson1_serializeOpCreateBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateBotInput(v *CreateBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBotInput(v *CreateBotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotMembers != nil {
ok := object.Key("botMembers")
if err := awsRestjson1_serializeDocumentBotMembers(v.BotMembers, ok); err != nil {
return err
}
}
if v.BotName != nil {
ok := object.Key("botName")
ok.String(*v.BotName)
}
if v.BotTags != nil {
ok := object.Key("botTags")
if err := awsRestjson1_serializeDocumentTagMap(v.BotTags, ok); err != nil {
return err
}
}
if len(v.BotType) > 0 {
ok := object.Key("botType")
ok.String(string(v.BotType))
}
if v.DataPrivacy != nil {
ok := object.Key("dataPrivacy")
if err := awsRestjson1_serializeDocumentDataPrivacy(v.DataPrivacy, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.IdleSessionTTLInSeconds != nil {
ok := object.Key("idleSessionTTLInSeconds")
ok.Integer(*v.IdleSessionTTLInSeconds)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.TestBotAliasTags != nil {
ok := object.Key("testBotAliasTags")
if err := awsRestjson1_serializeDocumentTagMap(v.TestBotAliasTags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateBotAlias struct {
}
func (*awsRestjson1_serializeOpCreateBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botaliases")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateBotAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBotAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateBotAliasInput(v *CreateBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBotAliasInput(v *CreateBotAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasLocaleSettings != nil {
ok := object.Key("botAliasLocaleSettings")
if err := awsRestjson1_serializeDocumentBotAliasLocaleSettingsMap(v.BotAliasLocaleSettings, ok); err != nil {
return err
}
}
if v.BotAliasName != nil {
ok := object.Key("botAliasName")
ok.String(*v.BotAliasName)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.ConversationLogSettings != nil {
ok := object.Key("conversationLogSettings")
if err := awsRestjson1_serializeDocumentConversationLogSettings(v.ConversationLogSettings, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.SentimentAnalysisSettings != nil {
ok := object.Key("sentimentAnalysisSettings")
if err := awsRestjson1_serializeDocumentSentimentAnalysisSettings(v.SentimentAnalysisSettings, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateBotLocale struct {
}
func (*awsRestjson1_serializeOpCreateBotLocale) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBotLocale) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBotLocaleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateBotLocaleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBotLocaleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateBotLocaleInput(v *CreateBotLocaleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBotLocaleInput(v *CreateBotLocaleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
if v.NluIntentConfidenceThreshold != nil {
ok := object.Key("nluIntentConfidenceThreshold")
switch {
case math.IsNaN(*v.NluIntentConfidenceThreshold):
ok.String("NaN")
case math.IsInf(*v.NluIntentConfidenceThreshold, 1):
ok.String("Infinity")
case math.IsInf(*v.NluIntentConfidenceThreshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.NluIntentConfidenceThreshold)
}
}
if v.VoiceSettings != nil {
ok := object.Key("voiceSettings")
if err := awsRestjson1_serializeDocumentVoiceSettings(v.VoiceSettings, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateBotVersion struct {
}
func (*awsRestjson1_serializeOpCreateBotVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBotVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBotVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateBotVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBotVersionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateBotVersionInput(v *CreateBotVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBotVersionInput(v *CreateBotVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotVersionLocaleSpecification != nil {
ok := object.Key("botVersionLocaleSpecification")
if err := awsRestjson1_serializeDocumentBotVersionLocaleSpecification(v.BotVersionLocaleSpecification, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
return nil
}
type awsRestjson1_serializeOpCreateExport struct {
}
func (*awsRestjson1_serializeOpCreateExport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateExportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateExportInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateExportInput(v *CreateExportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateExportInput(v *CreateExportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FileFormat) > 0 {
ok := object.Key("fileFormat")
ok.String(string(v.FileFormat))
}
if v.FilePassword != nil {
ok := object.Key("filePassword")
ok.String(*v.FilePassword)
}
if v.ResourceSpecification != nil {
ok := object.Key("resourceSpecification")
if err := awsRestjson1_serializeDocumentExportResourceSpecification(v.ResourceSpecification, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateIntent struct {
}
func (*awsRestjson1_serializeOpCreateIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateIntentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateIntentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateIntentInput(v *CreateIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateIntentInput(v *CreateIntentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DialogCodeHook != nil {
ok := object.Key("dialogCodeHook")
if err := awsRestjson1_serializeDocumentDialogCodeHookSettings(v.DialogCodeHook, ok); err != nil {
return err
}
}
if v.FulfillmentCodeHook != nil {
ok := object.Key("fulfillmentCodeHook")
if err := awsRestjson1_serializeDocumentFulfillmentCodeHookSettings(v.FulfillmentCodeHook, ok); err != nil {
return err
}
}
if v.InitialResponseSetting != nil {
ok := object.Key("initialResponseSetting")
if err := awsRestjson1_serializeDocumentInitialResponseSetting(v.InitialResponseSetting, ok); err != nil {
return err
}
}
if v.InputContexts != nil {
ok := object.Key("inputContexts")
if err := awsRestjson1_serializeDocumentInputContextsList(v.InputContexts, ok); err != nil {
return err
}
}
if v.IntentClosingSetting != nil {
ok := object.Key("intentClosingSetting")
if err := awsRestjson1_serializeDocumentIntentClosingSetting(v.IntentClosingSetting, ok); err != nil {
return err
}
}
if v.IntentConfirmationSetting != nil {
ok := object.Key("intentConfirmationSetting")
if err := awsRestjson1_serializeDocumentIntentConfirmationSetting(v.IntentConfirmationSetting, ok); err != nil {
return err
}
}
if v.IntentName != nil {
ok := object.Key("intentName")
ok.String(*v.IntentName)
}
if v.KendraConfiguration != nil {
ok := object.Key("kendraConfiguration")
if err := awsRestjson1_serializeDocumentKendraConfiguration(v.KendraConfiguration, ok); err != nil {
return err
}
}
if v.OutputContexts != nil {
ok := object.Key("outputContexts")
if err := awsRestjson1_serializeDocumentOutputContextsList(v.OutputContexts, ok); err != nil {
return err
}
}
if v.ParentIntentSignature != nil {
ok := object.Key("parentIntentSignature")
ok.String(*v.ParentIntentSignature)
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentSampleUtterancesList(v.SampleUtterances, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateResourcePolicy struct {
}
func (*awsRestjson1_serializeOpCreateResourcePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateResourcePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateResourcePolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateResourcePolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateResourcePolicyInput(v *CreateResourcePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateResourcePolicyInput(v *CreateResourcePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpCreateResourcePolicyStatement struct {
}
func (*awsRestjson1_serializeOpCreateResourcePolicyStatement) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateResourcePolicyStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateResourcePolicyStatementInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}/statements")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateResourcePolicyStatementInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateResourcePolicyStatementInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateResourcePolicyStatementInput(v *CreateResourcePolicyStatementInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExpectedRevisionId != nil {
encoder.SetQuery("expectedRevisionId").String(*v.ExpectedRevisionId)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateResourcePolicyStatementInput(v *CreateResourcePolicyStatementInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("action")
if err := awsRestjson1_serializeDocumentOperationList(v.Action, ok); err != nil {
return err
}
}
if v.Condition != nil {
ok := object.Key("condition")
if err := awsRestjson1_serializeDocumentConditionMap(v.Condition, ok); err != nil {
return err
}
}
if len(v.Effect) > 0 {
ok := object.Key("effect")
ok.String(string(v.Effect))
}
if v.Principal != nil {
ok := object.Key("principal")
if err := awsRestjson1_serializeDocumentPrincipalList(v.Principal, ok); err != nil {
return err
}
}
if v.StatementId != nil {
ok := object.Key("statementId")
ok.String(*v.StatementId)
}
return nil
}
type awsRestjson1_serializeOpCreateSlot struct {
}
func (*awsRestjson1_serializeOpCreateSlot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSlot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSlotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}/slots")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateSlotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateSlotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateSlotInput(v *CreateSlotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSlotInput(v *CreateSlotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.MultipleValuesSetting != nil {
ok := object.Key("multipleValuesSetting")
if err := awsRestjson1_serializeDocumentMultipleValuesSetting(v.MultipleValuesSetting, ok); err != nil {
return err
}
}
if v.ObfuscationSetting != nil {
ok := object.Key("obfuscationSetting")
if err := awsRestjson1_serializeDocumentObfuscationSetting(v.ObfuscationSetting, ok); err != nil {
return err
}
}
if v.SlotName != nil {
ok := object.Key("slotName")
ok.String(*v.SlotName)
}
if v.SlotTypeId != nil {
ok := object.Key("slotTypeId")
ok.String(*v.SlotTypeId)
}
if v.SubSlotSetting != nil {
ok := object.Key("subSlotSetting")
if err := awsRestjson1_serializeDocumentSubSlotSetting(v.SubSlotSetting, ok); err != nil {
return err
}
}
if v.ValueElicitationSetting != nil {
ok := object.Key("valueElicitationSetting")
if err := awsRestjson1_serializeDocumentSlotValueElicitationSetting(v.ValueElicitationSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateSlotType struct {
}
func (*awsRestjson1_serializeOpCreateSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/slottypes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateSlotTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateSlotTypeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateSlotTypeInput(v *CreateSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSlotTypeInput(v *CreateSlotTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompositeSlotTypeSetting != nil {
ok := object.Key("compositeSlotTypeSetting")
if err := awsRestjson1_serializeDocumentCompositeSlotTypeSetting(v.CompositeSlotTypeSetting, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.ExternalSourceSetting != nil {
ok := object.Key("externalSourceSetting")
if err := awsRestjson1_serializeDocumentExternalSourceSetting(v.ExternalSourceSetting, ok); err != nil {
return err
}
}
if v.ParentSlotTypeSignature != nil {
ok := object.Key("parentSlotTypeSignature")
ok.String(*v.ParentSlotTypeSignature)
}
if v.SlotTypeName != nil {
ok := object.Key("slotTypeName")
ok.String(*v.SlotTypeName)
}
if v.SlotTypeValues != nil {
ok := object.Key("slotTypeValues")
if err := awsRestjson1_serializeDocumentSlotTypeValues(v.SlotTypeValues, ok); err != nil {
return err
}
}
if v.ValueSelectionSetting != nil {
ok := object.Key("valueSelectionSetting")
if err := awsRestjson1_serializeDocumentSlotValueSelectionSetting(v.ValueSelectionSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateTestSetDiscrepancyReport struct {
}
func (*awsRestjson1_serializeOpCreateTestSetDiscrepancyReport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateTestSetDiscrepancyReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTestSetDiscrepancyReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}/testsetdiscrepancy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateTestSetDiscrepancyReportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateTestSetDiscrepancyReportInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateTestSetDiscrepancyReportInput(v *CreateTestSetDiscrepancyReportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateTestSetDiscrepancyReportInput(v *CreateTestSetDiscrepancyReportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Target != nil {
ok := object.Key("target")
if err := awsRestjson1_serializeDocumentTestSetDiscrepancyReportResourceTarget(v.Target, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateUploadUrl struct {
}
func (*awsRestjson1_serializeOpCreateUploadUrl) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateUploadUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateUploadUrlInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/createuploadurl")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateUploadUrlInput(v *CreateUploadUrlInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDeleteBot struct {
}
func (*awsRestjson1_serializeOpDeleteBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteBotInput(v *DeleteBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.SkipResourceInUseCheck {
encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck)
}
return nil
}
type awsRestjson1_serializeOpDeleteBotAlias struct {
}
func (*awsRestjson1_serializeOpDeleteBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botaliases/{botAliasId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteBotAliasInput(v *DeleteBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.SkipResourceInUseCheck {
encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck)
}
return nil
}
type awsRestjson1_serializeOpDeleteBotLocale struct {
}
func (*awsRestjson1_serializeOpDeleteBotLocale) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotLocale) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBotLocaleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotLocaleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteBotLocaleInput(v *DeleteBotLocaleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteBotVersion struct {
}
func (*awsRestjson1_serializeOpDeleteBotVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBotVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteBotVersionInput(v *DeleteBotVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.SkipResourceInUseCheck {
encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck)
}
return nil
}
type awsRestjson1_serializeOpDeleteCustomVocabulary struct {
}
func (*awsRestjson1_serializeOpDeleteCustomVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteCustomVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCustomVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteCustomVocabularyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteCustomVocabularyInput(v *DeleteCustomVocabularyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteExport struct {
}
func (*awsRestjson1_serializeOpDeleteExport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteExportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports/{exportId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteExportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteExportInput(v *DeleteExportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExportId == nil || len(*v.ExportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member exportId must not be empty")}
}
if v.ExportId != nil {
if err := encoder.SetURI("exportId").String(*v.ExportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteImport struct {
}
func (*awsRestjson1_serializeOpDeleteImport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteImportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports/{importId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteImportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteImportInput(v *DeleteImportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImportId == nil || len(*v.ImportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member importId must not be empty")}
}
if v.ImportId != nil {
if err := encoder.SetURI("importId").String(*v.ImportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteIntent struct {
}
func (*awsRestjson1_serializeOpDeleteIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteIntentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteIntentInput(v *DeleteIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteResourcePolicy struct {
}
func (*awsRestjson1_serializeOpDeleteResourcePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteResourcePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExpectedRevisionId != nil {
encoder.SetQuery("expectedRevisionId").String(*v.ExpectedRevisionId)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteResourcePolicyStatement struct {
}
func (*awsRestjson1_serializeOpDeleteResourcePolicyStatement) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteResourcePolicyStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteResourcePolicyStatementInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}/statements/{statementId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyStatementInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyStatementInput(v *DeleteResourcePolicyStatementInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExpectedRevisionId != nil {
encoder.SetQuery("expectedRevisionId").String(*v.ExpectedRevisionId)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.StatementId == nil || len(*v.StatementId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member statementId must not be empty")}
}
if v.StatementId != nil {
if err := encoder.SetURI("statementId").String(*v.StatementId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSlot struct {
}
func (*awsRestjson1_serializeOpDeleteSlot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSlotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}/slots/{slotId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteSlotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteSlotInput(v *DeleteSlotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SlotId == nil || len(*v.SlotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotId must not be empty")}
}
if v.SlotId != nil {
if err := encoder.SetURI("slotId").String(*v.SlotId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSlotType struct {
}
func (*awsRestjson1_serializeOpDeleteSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/slottypes/{slotTypeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeInput(v *DeleteSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SkipResourceInUseCheck {
encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck)
}
if v.SlotTypeId == nil || len(*v.SlotTypeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotTypeId must not be empty")}
}
if v.SlotTypeId != nil {
if err := encoder.SetURI("slotTypeId").String(*v.SlotTypeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteTestSet struct {
}
func (*awsRestjson1_serializeOpDeleteTestSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteTestSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTestSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteTestSetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteTestSetInput(v *DeleteTestSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteUtterances struct {
}
func (*awsRestjson1_serializeOpDeleteUtterances) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteUtterances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteUtterancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/utterances")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteUtterancesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteUtterancesInput(v *DeleteUtterancesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId != nil {
encoder.SetQuery("localeId").String(*v.LocaleId)
}
if v.SessionId != nil {
encoder.SetQuery("sessionId").String(*v.SessionId)
}
return nil
}
type awsRestjson1_serializeOpDescribeBot struct {
}
func (*awsRestjson1_serializeOpDescribeBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeBotInput(v *DescribeBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBotAlias struct {
}
func (*awsRestjson1_serializeOpDescribeBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botaliases/{botAliasId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBotAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeBotAliasInput(v *DescribeBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBotLocale struct {
}
func (*awsRestjson1_serializeOpDescribeBotLocale) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBotLocale) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBotLocaleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBotLocaleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeBotLocaleInput(v *DescribeBotLocaleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBotRecommendation struct {
}
func (*awsRestjson1_serializeOpDescribeBotRecommendation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBotRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBotRecommendationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations/{botRecommendationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBotRecommendationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeBotRecommendationInput(v *DescribeBotRecommendationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotRecommendationId == nil || len(*v.BotRecommendationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botRecommendationId must not be empty")}
}
if v.BotRecommendationId != nil {
if err := encoder.SetURI("botRecommendationId").String(*v.BotRecommendationId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBotVersion struct {
}
func (*awsRestjson1_serializeOpDescribeBotVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBotVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBotVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBotVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeBotVersionInput(v *DescribeBotVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeCustomVocabularyMetadata struct {
}
func (*awsRestjson1_serializeOpDescribeCustomVocabularyMetadata) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeCustomVocabularyMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCustomVocabularyMetadataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary/DEFAULT/metadata")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeCustomVocabularyMetadataInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeCustomVocabularyMetadataInput(v *DescribeCustomVocabularyMetadataInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeExport struct {
}
func (*awsRestjson1_serializeOpDescribeExport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeExportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports/{exportId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeExportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeExportInput(v *DescribeExportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExportId == nil || len(*v.ExportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member exportId must not be empty")}
}
if v.ExportId != nil {
if err := encoder.SetURI("exportId").String(*v.ExportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeImport struct {
}
func (*awsRestjson1_serializeOpDescribeImport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeImportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports/{importId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeImportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeImportInput(v *DescribeImportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImportId == nil || len(*v.ImportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member importId must not be empty")}
}
if v.ImportId != nil {
if err := encoder.SetURI("importId").String(*v.ImportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeIntent struct {
}
func (*awsRestjson1_serializeOpDescribeIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeIntentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeIntentInput(v *DescribeIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeResourcePolicy struct {
}
func (*awsRestjson1_serializeOpDescribeResourcePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeResourcePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeResourcePolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeResourcePolicyInput(v *DescribeResourcePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeSlot struct {
}
func (*awsRestjson1_serializeOpDescribeSlot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeSlot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSlotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}/slots/{slotId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeSlotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeSlotInput(v *DescribeSlotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SlotId == nil || len(*v.SlotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotId must not be empty")}
}
if v.SlotId != nil {
if err := encoder.SetURI("slotId").String(*v.SlotId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeSlotType struct {
}
func (*awsRestjson1_serializeOpDescribeSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/slottypes/{slotTypeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeSlotTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeSlotTypeInput(v *DescribeSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SlotTypeId == nil || len(*v.SlotTypeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotTypeId must not be empty")}
}
if v.SlotTypeId != nil {
if err := encoder.SetURI("slotTypeId").String(*v.SlotTypeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeTestExecution struct {
}
func (*awsRestjson1_serializeOpDescribeTestExecution) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTestExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTestExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testexecutions/{testExecutionId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeTestExecutionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeTestExecutionInput(v *DescribeTestExecutionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestExecutionId == nil || len(*v.TestExecutionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testExecutionId must not be empty")}
}
if v.TestExecutionId != nil {
if err := encoder.SetURI("testExecutionId").String(*v.TestExecutionId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeTestSet struct {
}
func (*awsRestjson1_serializeOpDescribeTestSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTestSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTestSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeTestSetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeTestSetInput(v *DescribeTestSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeTestSetDiscrepancyReport struct {
}
func (*awsRestjson1_serializeOpDescribeTestSetDiscrepancyReport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTestSetDiscrepancyReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTestSetDiscrepancyReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsetdiscrepancy/{testSetDiscrepancyReportId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeTestSetDiscrepancyReportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeTestSetDiscrepancyReportInput(v *DescribeTestSetDiscrepancyReportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetDiscrepancyReportId == nil || len(*v.TestSetDiscrepancyReportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetDiscrepancyReportId must not be empty")}
}
if v.TestSetDiscrepancyReportId != nil {
if err := encoder.SetURI("testSetDiscrepancyReportId").String(*v.TestSetDiscrepancyReportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeTestSetGeneration struct {
}
func (*awsRestjson1_serializeOpDescribeTestSetGeneration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTestSetGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTestSetGenerationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsetgenerations/{testSetGenerationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeTestSetGenerationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeTestSetGenerationInput(v *DescribeTestSetGenerationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetGenerationId == nil || len(*v.TestSetGenerationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetGenerationId must not be empty")}
}
if v.TestSetGenerationId != nil {
if err := encoder.SetURI("testSetGenerationId").String(*v.TestSetGenerationId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetTestExecutionArtifactsUrl struct {
}
func (*awsRestjson1_serializeOpGetTestExecutionArtifactsUrl) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetTestExecutionArtifactsUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetTestExecutionArtifactsUrlInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testexecutions/{testExecutionId}/artifacturl")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetTestExecutionArtifactsUrlInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetTestExecutionArtifactsUrlInput(v *GetTestExecutionArtifactsUrlInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestExecutionId == nil || len(*v.TestExecutionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testExecutionId must not be empty")}
}
if v.TestExecutionId != nil {
if err := encoder.SetURI("testExecutionId").String(*v.TestExecutionId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListAggregatedUtterances struct {
}
func (*awsRestjson1_serializeOpListAggregatedUtterances) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAggregatedUtterances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAggregatedUtterancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/aggregatedutterances")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListAggregatedUtterancesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAggregatedUtterancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAggregatedUtterancesInput(v *ListAggregatedUtterancesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListAggregatedUtterancesInput(v *ListAggregatedUtterancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AggregationDuration != nil {
ok := object.Key("aggregationDuration")
if err := awsRestjson1_serializeDocumentUtteranceAggregationDuration(v.AggregationDuration, ok); err != nil {
return err
}
}
if v.BotAliasId != nil {
ok := object.Key("botAliasId")
ok.String(*v.BotAliasId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentAggregatedUtterancesFilters(v.Filters, ok); err != nil {
return err
}
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentAggregatedUtterancesSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListBotAliases struct {
}
func (*awsRestjson1_serializeOpListBotAliases) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBotAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBotAliasesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botaliases")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBotAliasesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBotAliasesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBotAliasesInput(v *ListBotAliasesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBotAliasesInput(v *ListBotAliasesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListBotLocales struct {
}
func (*awsRestjson1_serializeOpListBotLocales) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBotLocales) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBotLocalesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBotLocalesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBotLocalesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBotLocalesInput(v *ListBotLocalesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBotLocalesInput(v *ListBotLocalesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentBotLocaleFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentBotLocaleSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListBotRecommendations struct {
}
func (*awsRestjson1_serializeOpListBotRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBotRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBotRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBotRecommendationsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBotRecommendationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBotRecommendationsInput(v *ListBotRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBotRecommendationsInput(v *ListBotRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListBots struct {
}
func (*awsRestjson1_serializeOpListBots) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBotsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBotsInput(v *ListBotsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListBotsInput(v *ListBotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentBotFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentBotSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListBotVersions struct {
}
func (*awsRestjson1_serializeOpListBotVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBotVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBotVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBotVersionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBotVersionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBotVersionsInput(v *ListBotVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBotVersionsInput(v *ListBotVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentBotVersionSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListBuiltInIntents struct {
}
func (*awsRestjson1_serializeOpListBuiltInIntents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBuiltInIntents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBuiltInIntentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/builtins/locales/{localeId}/intents")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBuiltInIntentsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBuiltInIntentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBuiltInIntentsInput(v *ListBuiltInIntentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBuiltInIntentsInput(v *ListBuiltInIntentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentBuiltInIntentSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListBuiltInSlotTypes struct {
}
func (*awsRestjson1_serializeOpListBuiltInSlotTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBuiltInSlotTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBuiltInSlotTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/builtins/locales/{localeId}/slottypes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBuiltInSlotTypesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListBuiltInSlotTypesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListBuiltInSlotTypesInput(v *ListBuiltInSlotTypesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListBuiltInSlotTypesInput(v *ListBuiltInSlotTypesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentBuiltInSlotTypeSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListCustomVocabularyItems struct {
}
func (*awsRestjson1_serializeOpListCustomVocabularyItems) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListCustomVocabularyItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListCustomVocabularyItemsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/customvocabulary/DEFAULT/list")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListCustomVocabularyItemsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListCustomVocabularyItemsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListCustomVocabularyItemsInput(v *ListCustomVocabularyItemsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListCustomVocabularyItemsInput(v *ListCustomVocabularyItemsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListExports struct {
}
func (*awsRestjson1_serializeOpListExports) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListExports) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListExportsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListExportsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListExportsInput(v *ListExportsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListExportsInput(v *ListExportsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentExportFilters(v.Filters, ok); err != nil {
return err
}
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentExportSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListImports struct {
}
func (*awsRestjson1_serializeOpListImports) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImports) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListImportsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImportsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListImportsInput(v *ListImportsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImportsInput(v *ListImportsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentImportFilters(v.Filters, ok); err != nil {
return err
}
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentImportSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListIntents struct {
}
func (*awsRestjson1_serializeOpListIntents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListIntents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListIntentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListIntentsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListIntentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListIntentsInput(v *ListIntentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListIntentsInput(v *ListIntentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentIntentFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentIntentSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListRecommendedIntents struct {
}
func (*awsRestjson1_serializeOpListRecommendedIntents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListRecommendedIntents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRecommendedIntentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations/{botRecommendationId}/intents")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListRecommendedIntentsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListRecommendedIntentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListRecommendedIntentsInput(v *ListRecommendedIntentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotRecommendationId == nil || len(*v.BotRecommendationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botRecommendationId must not be empty")}
}
if v.BotRecommendationId != nil {
if err := encoder.SetURI("botRecommendationId").String(*v.BotRecommendationId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListRecommendedIntentsInput(v *ListRecommendedIntentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListSlots struct {
}
func (*awsRestjson1_serializeOpListSlots) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSlots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSlotsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}/slots")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListSlotsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListSlotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListSlotsInput(v *ListSlotsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListSlotsInput(v *ListSlotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentSlotFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentSlotSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListSlotTypes struct {
}
func (*awsRestjson1_serializeOpListSlotTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSlotTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSlotTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/slottypes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListSlotTypesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListSlotTypesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListSlotTypesInput(v *ListSlotTypesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListSlotTypesInput(v *ListSlotTypesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentSlotTypeFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentSlotTypeSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceARN}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceARN == nil || len(*v.ResourceARN) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceARN must not be empty")}
}
if v.ResourceARN != nil {
if err := encoder.SetURI("resourceARN").String(*v.ResourceARN); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTestExecutionResultItems struct {
}
func (*awsRestjson1_serializeOpListTestExecutionResultItems) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTestExecutionResultItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTestExecutionResultItemsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testexecutions/{testExecutionId}/results")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTestExecutionResultItemsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTestExecutionResultItemsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTestExecutionResultItemsInput(v *ListTestExecutionResultItemsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestExecutionId == nil || len(*v.TestExecutionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testExecutionId must not be empty")}
}
if v.TestExecutionId != nil {
if err := encoder.SetURI("testExecutionId").String(*v.TestExecutionId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListTestExecutionResultItemsInput(v *ListTestExecutionResultItemsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ResultFilterBy != nil {
ok := object.Key("resultFilterBy")
if err := awsRestjson1_serializeDocumentTestExecutionResultFilterBy(v.ResultFilterBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTestExecutions struct {
}
func (*awsRestjson1_serializeOpListTestExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTestExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTestExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testexecutions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTestExecutionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTestExecutionsInput(v *ListTestExecutionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListTestExecutionsInput(v *ListTestExecutionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentTestExecutionSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTestSetRecords struct {
}
func (*awsRestjson1_serializeOpListTestSetRecords) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTestSetRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTestSetRecordsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}/records")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTestSetRecordsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTestSetRecordsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTestSetRecordsInput(v *ListTestSetRecordsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListTestSetRecordsInput(v *ListTestSetRecordsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTestSets struct {
}
func (*awsRestjson1_serializeOpListTestSets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTestSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTestSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTestSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTestSetsInput(v *ListTestSetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListTestSetsInput(v *ListTestSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.SortBy != nil {
ok := object.Key("sortBy")
if err := awsRestjson1_serializeDocumentTestSetSortBy(v.SortBy, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpSearchAssociatedTranscripts struct {
}
func (*awsRestjson1_serializeOpSearchAssociatedTranscripts) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSearchAssociatedTranscripts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchAssociatedTranscriptsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations/{botRecommendationId}/associatedtranscripts")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsSearchAssociatedTranscriptsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSearchAssociatedTranscriptsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsSearchAssociatedTranscriptsInput(v *SearchAssociatedTranscriptsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotRecommendationId == nil || len(*v.BotRecommendationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botRecommendationId must not be empty")}
}
if v.BotRecommendationId != nil {
if err := encoder.SetURI("botRecommendationId").String(*v.BotRecommendationId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentSearchAssociatedTranscriptsInput(v *SearchAssociatedTranscriptsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentAssociatedTranscriptFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextIndex != nil {
ok := object.Key("nextIndex")
ok.Integer(*v.NextIndex)
}
if len(v.SearchOrder) > 0 {
ok := object.Key("searchOrder")
ok.String(string(v.SearchOrder))
}
return nil
}
type awsRestjson1_serializeOpStartBotRecommendation struct {
}
func (*awsRestjson1_serializeOpStartBotRecommendation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartBotRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartBotRecommendationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartBotRecommendationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartBotRecommendationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartBotRecommendationInput(v *StartBotRecommendationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartBotRecommendationInput(v *StartBotRecommendationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EncryptionSetting != nil {
ok := object.Key("encryptionSetting")
if err := awsRestjson1_serializeDocumentEncryptionSetting(v.EncryptionSetting, ok); err != nil {
return err
}
}
if v.TranscriptSourceSetting != nil {
ok := object.Key("transcriptSourceSetting")
if err := awsRestjson1_serializeDocumentTranscriptSourceSetting(v.TranscriptSourceSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStartImport struct {
}
func (*awsRestjson1_serializeOpStartImport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartImportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartImportInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartImportInput(v *StartImportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartImportInput(v *StartImportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FilePassword != nil {
ok := object.Key("filePassword")
ok.String(*v.FilePassword)
}
if v.ImportId != nil {
ok := object.Key("importId")
ok.String(*v.ImportId)
}
if len(v.MergeStrategy) > 0 {
ok := object.Key("mergeStrategy")
ok.String(string(v.MergeStrategy))
}
if v.ResourceSpecification != nil {
ok := object.Key("resourceSpecification")
if err := awsRestjson1_serializeDocumentImportResourceSpecification(v.ResourceSpecification, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStartTestExecution struct {
}
func (*awsRestjson1_serializeOpStartTestExecution) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartTestExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartTestExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}/testexecutions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartTestExecutionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartTestExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartTestExecutionInput(v *StartTestExecutionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartTestExecutionInput(v *StartTestExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ApiMode) > 0 {
ok := object.Key("apiMode")
ok.String(string(v.ApiMode))
}
if v.Target != nil {
ok := object.Key("target")
if err := awsRestjson1_serializeDocumentTestExecutionTarget(v.Target, ok); err != nil {
return err
}
}
if len(v.TestExecutionModality) > 0 {
ok := object.Key("testExecutionModality")
ok.String(string(v.TestExecutionModality))
}
return nil
}
type awsRestjson1_serializeOpStartTestSetGeneration struct {
}
func (*awsRestjson1_serializeOpStartTestSetGeneration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartTestSetGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartTestSetGenerationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsetgenerations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartTestSetGenerationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartTestSetGenerationInput(v *StartTestSetGenerationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartTestSetGenerationInput(v *StartTestSetGenerationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.GenerationDataSource != nil {
ok := object.Key("generationDataSource")
if err := awsRestjson1_serializeDocumentTestSetGenerationDataSource(v.GenerationDataSource, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.StorageLocation != nil {
ok := object.Key("storageLocation")
if err := awsRestjson1_serializeDocumentTestSetStorageLocation(v.StorageLocation, ok); err != nil {
return err
}
}
if v.TestSetName != nil {
ok := object.Key("testSetName")
ok.String(*v.TestSetName)
}
if v.TestSetTags != nil {
ok := object.Key("testSetTags")
if err := awsRestjson1_serializeDocumentTagMap(v.TestSetTags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStopBotRecommendation struct {
}
func (*awsRestjson1_serializeOpStopBotRecommendation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStopBotRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopBotRecommendationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations/{botRecommendationId}/stopbotrecommendation")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStopBotRecommendationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStopBotRecommendationInput(v *StopBotRecommendationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotRecommendationId == nil || len(*v.BotRecommendationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botRecommendationId must not be empty")}
}
if v.BotRecommendationId != nil {
if err := encoder.SetURI("botRecommendationId").String(*v.BotRecommendationId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceARN}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceARN == nil || len(*v.ResourceARN) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceARN must not be empty")}
}
if v.ResourceARN != nil {
if err := encoder.SetURI("resourceARN").String(*v.ResourceARN); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceARN}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceARN == nil || len(*v.ResourceARN) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceARN must not be empty")}
}
if v.ResourceARN != nil {
if err := encoder.SetURI("resourceARN").String(*v.ResourceARN); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateBot struct {
}
func (*awsRestjson1_serializeOpUpdateBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateBotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateBotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateBotInput(v *UpdateBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateBotInput(v *UpdateBotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotMembers != nil {
ok := object.Key("botMembers")
if err := awsRestjson1_serializeDocumentBotMembers(v.BotMembers, ok); err != nil {
return err
}
}
if v.BotName != nil {
ok := object.Key("botName")
ok.String(*v.BotName)
}
if len(v.BotType) > 0 {
ok := object.Key("botType")
ok.String(string(v.BotType))
}
if v.DataPrivacy != nil {
ok := object.Key("dataPrivacy")
if err := awsRestjson1_serializeDocumentDataPrivacy(v.DataPrivacy, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.IdleSessionTTLInSeconds != nil {
ok := object.Key("idleSessionTTLInSeconds")
ok.Integer(*v.IdleSessionTTLInSeconds)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
type awsRestjson1_serializeOpUpdateBotAlias struct {
}
func (*awsRestjson1_serializeOpUpdateBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botaliases/{botAliasId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateBotAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateBotAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateBotAliasInput(v *UpdateBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateBotAliasInput(v *UpdateBotAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasLocaleSettings != nil {
ok := object.Key("botAliasLocaleSettings")
if err := awsRestjson1_serializeDocumentBotAliasLocaleSettingsMap(v.BotAliasLocaleSettings, ok); err != nil {
return err
}
}
if v.BotAliasName != nil {
ok := object.Key("botAliasName")
ok.String(*v.BotAliasName)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.ConversationLogSettings != nil {
ok := object.Key("conversationLogSettings")
if err := awsRestjson1_serializeDocumentConversationLogSettings(v.ConversationLogSettings, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.SentimentAnalysisSettings != nil {
ok := object.Key("sentimentAnalysisSettings")
if err := awsRestjson1_serializeDocumentSentimentAnalysisSettings(v.SentimentAnalysisSettings, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateBotLocale struct {
}
func (*awsRestjson1_serializeOpUpdateBotLocale) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateBotLocale) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBotLocaleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateBotLocaleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateBotLocaleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateBotLocaleInput(v *UpdateBotLocaleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateBotLocaleInput(v *UpdateBotLocaleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.NluIntentConfidenceThreshold != nil {
ok := object.Key("nluIntentConfidenceThreshold")
switch {
case math.IsNaN(*v.NluIntentConfidenceThreshold):
ok.String("NaN")
case math.IsInf(*v.NluIntentConfidenceThreshold, 1):
ok.String("Infinity")
case math.IsInf(*v.NluIntentConfidenceThreshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.NluIntentConfidenceThreshold)
}
}
if v.VoiceSettings != nil {
ok := object.Key("voiceSettings")
if err := awsRestjson1_serializeDocumentVoiceSettings(v.VoiceSettings, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateBotRecommendation struct {
}
func (*awsRestjson1_serializeOpUpdateBotRecommendation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateBotRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBotRecommendationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/botrecommendations/{botRecommendationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateBotRecommendationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateBotRecommendationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateBotRecommendationInput(v *UpdateBotRecommendationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotRecommendationId == nil || len(*v.BotRecommendationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botRecommendationId must not be empty")}
}
if v.BotRecommendationId != nil {
if err := encoder.SetURI("botRecommendationId").String(*v.BotRecommendationId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateBotRecommendationInput(v *UpdateBotRecommendationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EncryptionSetting != nil {
ok := object.Key("encryptionSetting")
if err := awsRestjson1_serializeDocumentEncryptionSetting(v.EncryptionSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateExport struct {
}
func (*awsRestjson1_serializeOpUpdateExport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateExportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports/{exportId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateExportInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateExportInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateExportInput(v *UpdateExportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExportId == nil || len(*v.ExportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member exportId must not be empty")}
}
if v.ExportId != nil {
if err := encoder.SetURI("exportId").String(*v.ExportId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateExportInput(v *UpdateExportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FilePassword != nil {
ok := object.Key("filePassword")
ok.String(*v.FilePassword)
}
return nil
}
type awsRestjson1_serializeOpUpdateIntent struct {
}
func (*awsRestjson1_serializeOpUpdateIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateIntentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateIntentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateIntentInput(v *UpdateIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateIntentInput(v *UpdateIntentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DialogCodeHook != nil {
ok := object.Key("dialogCodeHook")
if err := awsRestjson1_serializeDocumentDialogCodeHookSettings(v.DialogCodeHook, ok); err != nil {
return err
}
}
if v.FulfillmentCodeHook != nil {
ok := object.Key("fulfillmentCodeHook")
if err := awsRestjson1_serializeDocumentFulfillmentCodeHookSettings(v.FulfillmentCodeHook, ok); err != nil {
return err
}
}
if v.InitialResponseSetting != nil {
ok := object.Key("initialResponseSetting")
if err := awsRestjson1_serializeDocumentInitialResponseSetting(v.InitialResponseSetting, ok); err != nil {
return err
}
}
if v.InputContexts != nil {
ok := object.Key("inputContexts")
if err := awsRestjson1_serializeDocumentInputContextsList(v.InputContexts, ok); err != nil {
return err
}
}
if v.IntentClosingSetting != nil {
ok := object.Key("intentClosingSetting")
if err := awsRestjson1_serializeDocumentIntentClosingSetting(v.IntentClosingSetting, ok); err != nil {
return err
}
}
if v.IntentConfirmationSetting != nil {
ok := object.Key("intentConfirmationSetting")
if err := awsRestjson1_serializeDocumentIntentConfirmationSetting(v.IntentConfirmationSetting, ok); err != nil {
return err
}
}
if v.IntentName != nil {
ok := object.Key("intentName")
ok.String(*v.IntentName)
}
if v.KendraConfiguration != nil {
ok := object.Key("kendraConfiguration")
if err := awsRestjson1_serializeDocumentKendraConfiguration(v.KendraConfiguration, ok); err != nil {
return err
}
}
if v.OutputContexts != nil {
ok := object.Key("outputContexts")
if err := awsRestjson1_serializeDocumentOutputContextsList(v.OutputContexts, ok); err != nil {
return err
}
}
if v.ParentIntentSignature != nil {
ok := object.Key("parentIntentSignature")
ok.String(*v.ParentIntentSignature)
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentSampleUtterancesList(v.SampleUtterances, ok); err != nil {
return err
}
}
if v.SlotPriorities != nil {
ok := object.Key("slotPriorities")
if err := awsRestjson1_serializeDocumentSlotPrioritiesList(v.SlotPriorities, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateResourcePolicy struct {
}
func (*awsRestjson1_serializeOpUpdateResourcePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateResourcePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/policy/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateResourcePolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateResourcePolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateResourcePolicyInput(v *UpdateResourcePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ExpectedRevisionId != nil {
encoder.SetQuery("expectedRevisionId").String(*v.ExpectedRevisionId)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateResourcePolicyInput(v *UpdateResourcePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpUpdateSlot struct {
}
func (*awsRestjson1_serializeOpUpdateSlot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateSlot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSlotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/intents/{intentId}/slots/{slotId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateSlotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateSlotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateSlotInput(v *UpdateSlotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.IntentId == nil || len(*v.IntentId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member intentId must not be empty")}
}
if v.IntentId != nil {
if err := encoder.SetURI("intentId").String(*v.IntentId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SlotId == nil || len(*v.SlotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotId must not be empty")}
}
if v.SlotId != nil {
if err := encoder.SetURI("slotId").String(*v.SlotId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateSlotInput(v *UpdateSlotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.MultipleValuesSetting != nil {
ok := object.Key("multipleValuesSetting")
if err := awsRestjson1_serializeDocumentMultipleValuesSetting(v.MultipleValuesSetting, ok); err != nil {
return err
}
}
if v.ObfuscationSetting != nil {
ok := object.Key("obfuscationSetting")
if err := awsRestjson1_serializeDocumentObfuscationSetting(v.ObfuscationSetting, ok); err != nil {
return err
}
}
if v.SlotName != nil {
ok := object.Key("slotName")
ok.String(*v.SlotName)
}
if v.SlotTypeId != nil {
ok := object.Key("slotTypeId")
ok.String(*v.SlotTypeId)
}
if v.SubSlotSetting != nil {
ok := object.Key("subSlotSetting")
if err := awsRestjson1_serializeDocumentSubSlotSetting(v.SubSlotSetting, ok); err != nil {
return err
}
}
if v.ValueElicitationSetting != nil {
ok := object.Key("valueElicitationSetting")
if err := awsRestjson1_serializeDocumentSlotValueElicitationSetting(v.ValueElicitationSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateSlotType struct {
}
func (*awsRestjson1_serializeOpUpdateSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/slottypes/{slotTypeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateSlotTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateSlotTypeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateSlotTypeInput(v *UpdateSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.BotVersion == nil || len(*v.BotVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")}
}
if v.BotVersion != nil {
if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SlotTypeId == nil || len(*v.SlotTypeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member slotTypeId must not be empty")}
}
if v.SlotTypeId != nil {
if err := encoder.SetURI("slotTypeId").String(*v.SlotTypeId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateSlotTypeInput(v *UpdateSlotTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompositeSlotTypeSetting != nil {
ok := object.Key("compositeSlotTypeSetting")
if err := awsRestjson1_serializeDocumentCompositeSlotTypeSetting(v.CompositeSlotTypeSetting, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.ExternalSourceSetting != nil {
ok := object.Key("externalSourceSetting")
if err := awsRestjson1_serializeDocumentExternalSourceSetting(v.ExternalSourceSetting, ok); err != nil {
return err
}
}
if v.ParentSlotTypeSignature != nil {
ok := object.Key("parentSlotTypeSignature")
ok.String(*v.ParentSlotTypeSignature)
}
if v.SlotTypeName != nil {
ok := object.Key("slotTypeName")
ok.String(*v.SlotTypeName)
}
if v.SlotTypeValues != nil {
ok := object.Key("slotTypeValues")
if err := awsRestjson1_serializeDocumentSlotTypeValues(v.SlotTypeValues, ok); err != nil {
return err
}
}
if v.ValueSelectionSetting != nil {
ok := object.Key("valueSelectionSetting")
if err := awsRestjson1_serializeDocumentSlotValueSelectionSetting(v.ValueSelectionSetting, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateTestSet struct {
}
func (*awsRestjson1_serializeOpUpdateTestSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateTestSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateTestSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/testsets/{testSetId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateTestSetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateTestSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateTestSetInput(v *UpdateTestSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestSetId == nil || len(*v.TestSetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member testSetId must not be empty")}
}
if v.TestSetId != nil {
if err := encoder.SetURI("testSetId").String(*v.TestSetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateTestSetInput(v *UpdateTestSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.TestSetName != nil {
ok := object.Key("testSetName")
ok.String(*v.TestSetName)
}
return nil
}
func awsRestjson1_serializeDocumentAdvancedRecognitionSetting(v *types.AdvancedRecognitionSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AudioRecognitionStrategy) > 0 {
ok := object.Key("audioRecognitionStrategy")
ok.String(string(v.AudioRecognitionStrategy))
}
return nil
}
func awsRestjson1_serializeDocumentAggregatedUtterancesFilter(v *types.AggregatedUtterancesFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAggregatedUtterancesFilters(v []types.AggregatedUtterancesFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAggregatedUtterancesFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAggregatedUtterancesSortBy(v *types.AggregatedUtterancesSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentAllowedInputTypes(v *types.AllowedInputTypes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowAudioInput != nil {
ok := object.Key("allowAudioInput")
ok.Boolean(*v.AllowAudioInput)
}
if v.AllowDTMFInput != nil {
ok := object.Key("allowDTMFInput")
ok.Boolean(*v.AllowDTMFInput)
}
return nil
}
func awsRestjson1_serializeDocumentAssociatedTranscriptFilter(v *types.AssociatedTranscriptFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssociatedTranscriptFilters(v []types.AssociatedTranscriptFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssociatedTranscriptFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAudioAndDTMFInputSpecification(v *types.AudioAndDTMFInputSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AudioSpecification != nil {
ok := object.Key("audioSpecification")
if err := awsRestjson1_serializeDocumentAudioSpecification(v.AudioSpecification, ok); err != nil {
return err
}
}
if v.DtmfSpecification != nil {
ok := object.Key("dtmfSpecification")
if err := awsRestjson1_serializeDocumentDTMFSpecification(v.DtmfSpecification, ok); err != nil {
return err
}
}
if v.StartTimeoutMs != nil {
ok := object.Key("startTimeoutMs")
ok.Integer(*v.StartTimeoutMs)
}
return nil
}
func awsRestjson1_serializeDocumentAudioLogDestination(v *types.AudioLogDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Bucket != nil {
ok := object.Key("s3Bucket")
if err := awsRestjson1_serializeDocumentS3BucketLogDestination(v.S3Bucket, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAudioLogSetting(v *types.AudioLogSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("destination")
if err := awsRestjson1_serializeDocumentAudioLogDestination(v.Destination, ok); err != nil {
return err
}
}
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
return nil
}
func awsRestjson1_serializeDocumentAudioLogSettingsList(v []types.AudioLogSetting, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAudioLogSetting(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAudioSpecification(v *types.AudioSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTimeoutMs != nil {
ok := object.Key("endTimeoutMs")
ok.Integer(*v.EndTimeoutMs)
}
if v.MaxLengthMs != nil {
ok := object.Key("maxLengthMs")
ok.Integer(*v.MaxLengthMs)
}
return nil
}
func awsRestjson1_serializeDocumentBotAliasLocaleSettings(v *types.BotAliasLocaleSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeHookSpecification != nil {
ok := object.Key("codeHookSpecification")
if err := awsRestjson1_serializeDocumentCodeHookSpecification(v.CodeHookSpecification, ok); err != nil {
return err
}
}
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
return nil
}
func awsRestjson1_serializeDocumentBotAliasLocaleSettingsMap(v map[string]types.BotAliasLocaleSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentBotAliasLocaleSettings(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotAliasTestExecutionTarget(v *types.BotAliasTestExecutionTarget, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasId != nil {
ok := object.Key("botAliasId")
ok.String(*v.BotAliasId)
}
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentBotExportSpecification(v *types.BotExportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
return nil
}
func awsRestjson1_serializeDocumentBotFilter(v *types.BotFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotFilters(v []types.BotFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBotFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotImportSpecification(v *types.BotImportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotName != nil {
ok := object.Key("botName")
ok.String(*v.BotName)
}
if v.BotTags != nil {
ok := object.Key("botTags")
if err := awsRestjson1_serializeDocumentTagMap(v.BotTags, ok); err != nil {
return err
}
}
if v.DataPrivacy != nil {
ok := object.Key("dataPrivacy")
if err := awsRestjson1_serializeDocumentDataPrivacy(v.DataPrivacy, ok); err != nil {
return err
}
}
if v.IdleSessionTTLInSeconds != nil {
ok := object.Key("idleSessionTTLInSeconds")
ok.Integer(*v.IdleSessionTTLInSeconds)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.TestBotAliasTags != nil {
ok := object.Key("testBotAliasTags")
if err := awsRestjson1_serializeDocumentTagMap(v.TestBotAliasTags, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotLocaleExportSpecification(v *types.BotLocaleExportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentBotLocaleFilter(v *types.BotLocaleFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotLocaleFilters(v []types.BotLocaleFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBotLocaleFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotLocaleImportSpecification(v *types.BotLocaleImportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
if v.NluIntentConfidenceThreshold != nil {
ok := object.Key("nluIntentConfidenceThreshold")
switch {
case math.IsNaN(*v.NluIntentConfidenceThreshold):
ok.String("NaN")
case math.IsInf(*v.NluIntentConfidenceThreshold, 1):
ok.String("Infinity")
case math.IsInf(*v.NluIntentConfidenceThreshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.NluIntentConfidenceThreshold)
}
}
if v.VoiceSettings != nil {
ok := object.Key("voiceSettings")
if err := awsRestjson1_serializeDocumentVoiceSettings(v.VoiceSettings, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotLocaleSortBy(v *types.BotLocaleSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentBotMember(v *types.BotMember, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotMemberAliasId != nil {
ok := object.Key("botMemberAliasId")
ok.String(*v.BotMemberAliasId)
}
if v.BotMemberAliasName != nil {
ok := object.Key("botMemberAliasName")
ok.String(*v.BotMemberAliasName)
}
if v.BotMemberId != nil {
ok := object.Key("botMemberId")
ok.String(*v.BotMemberId)
}
if v.BotMemberName != nil {
ok := object.Key("botMemberName")
ok.String(*v.BotMemberName)
}
if v.BotMemberVersion != nil {
ok := object.Key("botMemberVersion")
ok.String(*v.BotMemberVersion)
}
return nil
}
func awsRestjson1_serializeDocumentBotMembers(v []types.BotMember, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBotMember(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotSortBy(v *types.BotSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentBotVersionLocaleDetails(v *types.BotVersionLocaleDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SourceBotVersion != nil {
ok := object.Key("sourceBotVersion")
ok.String(*v.SourceBotVersion)
}
return nil
}
func awsRestjson1_serializeDocumentBotVersionLocaleSpecification(v map[string]types.BotVersionLocaleDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentBotVersionLocaleDetails(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBotVersionSortBy(v *types.BotVersionSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentBuiltInIntentSortBy(v *types.BuiltInIntentSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentBuiltInSlotTypeSortBy(v *types.BuiltInSlotTypeSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentButton(v *types.Button, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Text != nil {
ok := object.Key("text")
ok.String(*v.Text)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentButtonsList(v []types.Button, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentButton(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCloudWatchLogGroupLogDestination(v *types.CloudWatchLogGroupLogDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLogGroupArn != nil {
ok := object.Key("cloudWatchLogGroupArn")
ok.String(*v.CloudWatchLogGroupArn)
}
if v.LogPrefix != nil {
ok := object.Key("logPrefix")
ok.String(*v.LogPrefix)
}
return nil
}
func awsRestjson1_serializeDocumentCodeHookSpecification(v *types.CodeHookSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LambdaCodeHook != nil {
ok := object.Key("lambdaCodeHook")
if err := awsRestjson1_serializeDocumentLambdaCodeHook(v.LambdaCodeHook, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCompositeSlotTypeSetting(v *types.CompositeSlotTypeSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SubSlots != nil {
ok := object.Key("subSlots")
if err := awsRestjson1_serializeDocumentSubSlotTypeList(v.SubSlots, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCondition(v *types.Condition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExpressionString != nil {
ok := object.Key("expressionString")
ok.String(*v.ExpressionString)
}
return nil
}
func awsRestjson1_serializeDocumentConditionalBranch(v *types.ConditionalBranch, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Condition != nil {
ok := object.Key("condition")
if err := awsRestjson1_serializeDocumentCondition(v.Condition, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.NextStep != nil {
ok := object.Key("nextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.NextStep, ok); err != nil {
return err
}
}
if v.Response != nil {
ok := object.Key("response")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.Response, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConditionalBranches(v []types.ConditionalBranch, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentConditionalBranch(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConditionalSpecification(v *types.ConditionalSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.ConditionalBranches != nil {
ok := object.Key("conditionalBranches")
if err := awsRestjson1_serializeDocumentConditionalBranches(v.ConditionalBranches, ok); err != nil {
return err
}
}
if v.DefaultBranch != nil {
ok := object.Key("defaultBranch")
if err := awsRestjson1_serializeDocumentDefaultConditionalBranch(v.DefaultBranch, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConditionKeyValueMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentConditionMap(v map[string]map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentConditionKeyValueMap(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConversationLevelTestResultsFilterBy(v *types.ConversationLevelTestResultsFilterBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EndToEndResult) > 0 {
ok := object.Key("endToEndResult")
ok.String(string(v.EndToEndResult))
}
return nil
}
func awsRestjson1_serializeDocumentConversationLogsDataSource(v *types.ConversationLogsDataSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasId != nil {
ok := object.Key("botAliasId")
ok.String(*v.BotAliasId)
}
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.Filter != nil {
ok := object.Key("filter")
if err := awsRestjson1_serializeDocumentConversationLogsDataSourceFilterBy(v.Filter, ok); err != nil {
return err
}
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentConversationLogsDataSourceFilterBy(v *types.ConversationLogsDataSourceFilterBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if len(v.InputMode) > 0 {
ok := object.Key("inputMode")
ok.String(string(v.InputMode))
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsRestjson1_serializeDocumentConversationLogSettings(v *types.ConversationLogSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AudioLogSettings != nil {
ok := object.Key("audioLogSettings")
if err := awsRestjson1_serializeDocumentAudioLogSettingsList(v.AudioLogSettings, ok); err != nil {
return err
}
}
if v.TextLogSettings != nil {
ok := object.Key("textLogSettings")
if err := awsRestjson1_serializeDocumentTextLogSettingsList(v.TextLogSettings, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateCustomVocabularyItemsList(v []types.NewCustomVocabularyItem, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentNewCustomVocabularyItem(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCustomPayload(v *types.CustomPayload, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentCustomVocabularyEntryId(v *types.CustomVocabularyEntryId, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ItemId != nil {
ok := object.Key("itemId")
ok.String(*v.ItemId)
}
return nil
}
func awsRestjson1_serializeDocumentCustomVocabularyExportSpecification(v *types.CustomVocabularyExportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentCustomVocabularyImportSpecification(v *types.CustomVocabularyImportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentCustomVocabularyItem(v *types.CustomVocabularyItem, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DisplayAs != nil {
ok := object.Key("displayAs")
ok.String(*v.DisplayAs)
}
if v.ItemId != nil {
ok := object.Key("itemId")
ok.String(*v.ItemId)
}
if v.Phrase != nil {
ok := object.Key("phrase")
ok.String(*v.Phrase)
}
if v.Weight != nil {
ok := object.Key("weight")
ok.Integer(*v.Weight)
}
return nil
}
func awsRestjson1_serializeDocumentDataPrivacy(v *types.DataPrivacy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("childDirected")
ok.Boolean(v.ChildDirected)
}
return nil
}
func awsRestjson1_serializeDocumentDateRangeFilter(v *types.DateRangeFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndDateTime != nil {
ok := object.Key("endDateTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDateTime))
}
if v.StartDateTime != nil {
ok := object.Key("startDateTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDateTime))
}
return nil
}
func awsRestjson1_serializeDocumentDefaultConditionalBranch(v *types.DefaultConditionalBranch, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NextStep != nil {
ok := object.Key("nextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.NextStep, ok); err != nil {
return err
}
}
if v.Response != nil {
ok := object.Key("response")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.Response, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDeleteCustomVocabularyItemsList(v []types.CustomVocabularyEntryId, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentCustomVocabularyEntryId(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDialogAction(v *types.DialogAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SlotToElicit != nil {
ok := object.Key("slotToElicit")
ok.String(*v.SlotToElicit)
}
if v.SuppressNextMessage != nil {
ok := object.Key("suppressNextMessage")
ok.Boolean(*v.SuppressNextMessage)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentDialogCodeHookInvocationSetting(v *types.DialogCodeHookInvocationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.EnableCodeHookInvocation != nil {
ok := object.Key("enableCodeHookInvocation")
ok.Boolean(*v.EnableCodeHookInvocation)
}
if v.InvocationLabel != nil {
ok := object.Key("invocationLabel")
ok.String(*v.InvocationLabel)
}
if v.PostCodeHookSpecification != nil {
ok := object.Key("postCodeHookSpecification")
if err := awsRestjson1_serializeDocumentPostDialogCodeHookInvocationSpecification(v.PostCodeHookSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDialogCodeHookSettings(v *types.DialogCodeHookSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
return nil
}
func awsRestjson1_serializeDocumentDialogState(v *types.DialogState, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DialogAction != nil {
ok := object.Key("dialogAction")
if err := awsRestjson1_serializeDocumentDialogAction(v.DialogAction, ok); err != nil {
return err
}
}
if v.Intent != nil {
ok := object.Key("intent")
if err := awsRestjson1_serializeDocumentIntentOverride(v.Intent, ok); err != nil {
return err
}
}
if v.SessionAttributes != nil {
ok := object.Key("sessionAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDTMFSpecification(v *types.DTMFSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeletionCharacter != nil {
ok := object.Key("deletionCharacter")
ok.String(*v.DeletionCharacter)
}
if v.EndCharacter != nil {
ok := object.Key("endCharacter")
ok.String(*v.EndCharacter)
}
if v.EndTimeoutMs != nil {
ok := object.Key("endTimeoutMs")
ok.Integer(*v.EndTimeoutMs)
}
if v.MaxLength != nil {
ok := object.Key("maxLength")
ok.Integer(*v.MaxLength)
}
return nil
}
func awsRestjson1_serializeDocumentElicitationCodeHookInvocationSetting(v *types.ElicitationCodeHookInvocationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EnableCodeHookInvocation != nil {
ok := object.Key("enableCodeHookInvocation")
ok.Boolean(*v.EnableCodeHookInvocation)
}
if v.InvocationLabel != nil {
ok := object.Key("invocationLabel")
ok.String(*v.InvocationLabel)
}
return nil
}
func awsRestjson1_serializeDocumentEncryptionSetting(v *types.EncryptionSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssociatedTranscriptsPassword != nil {
ok := object.Key("associatedTranscriptsPassword")
ok.String(*v.AssociatedTranscriptsPassword)
}
if v.BotLocaleExportPassword != nil {
ok := object.Key("botLocaleExportPassword")
ok.String(*v.BotLocaleExportPassword)
}
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
return nil
}
func awsRestjson1_serializeDocumentExportFilter(v *types.ExportFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExportFilters(v []types.ExportFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentExportFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExportResourceSpecification(v *types.ExportResourceSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotExportSpecification != nil {
ok := object.Key("botExportSpecification")
if err := awsRestjson1_serializeDocumentBotExportSpecification(v.BotExportSpecification, ok); err != nil {
return err
}
}
if v.BotLocaleExportSpecification != nil {
ok := object.Key("botLocaleExportSpecification")
if err := awsRestjson1_serializeDocumentBotLocaleExportSpecification(v.BotLocaleExportSpecification, ok); err != nil {
return err
}
}
if v.CustomVocabularyExportSpecification != nil {
ok := object.Key("customVocabularyExportSpecification")
if err := awsRestjson1_serializeDocumentCustomVocabularyExportSpecification(v.CustomVocabularyExportSpecification, ok); err != nil {
return err
}
}
if v.TestSetExportSpecification != nil {
ok := object.Key("testSetExportSpecification")
if err := awsRestjson1_serializeDocumentTestSetExportSpecification(v.TestSetExportSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExportSortBy(v *types.ExportSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentExternalSourceSetting(v *types.ExternalSourceSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GrammarSlotTypeSetting != nil {
ok := object.Key("grammarSlotTypeSetting")
if err := awsRestjson1_serializeDocumentGrammarSlotTypeSetting(v.GrammarSlotTypeSetting, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilterValues(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentFulfillmentCodeHookSettings(v *types.FulfillmentCodeHookSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
if v.FulfillmentUpdatesSpecification != nil {
ok := object.Key("fulfillmentUpdatesSpecification")
if err := awsRestjson1_serializeDocumentFulfillmentUpdatesSpecification(v.FulfillmentUpdatesSpecification, ok); err != nil {
return err
}
}
if v.PostFulfillmentStatusSpecification != nil {
ok := object.Key("postFulfillmentStatusSpecification")
if err := awsRestjson1_serializeDocumentPostFulfillmentStatusSpecification(v.PostFulfillmentStatusSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFulfillmentStartResponseSpecification(v *types.FulfillmentStartResponseSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.DelayInSeconds != nil {
ok := object.Key("delayInSeconds")
ok.Integer(*v.DelayInSeconds)
}
if v.MessageGroups != nil {
ok := object.Key("messageGroups")
if err := awsRestjson1_serializeDocumentMessageGroupsList(v.MessageGroups, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFulfillmentUpdateResponseSpecification(v *types.FulfillmentUpdateResponseSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.FrequencyInSeconds != nil {
ok := object.Key("frequencyInSeconds")
ok.Integer(*v.FrequencyInSeconds)
}
if v.MessageGroups != nil {
ok := object.Key("messageGroups")
if err := awsRestjson1_serializeDocumentMessageGroupsList(v.MessageGroups, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFulfillmentUpdatesSpecification(v *types.FulfillmentUpdatesSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.StartResponse != nil {
ok := object.Key("startResponse")
if err := awsRestjson1_serializeDocumentFulfillmentStartResponseSpecification(v.StartResponse, ok); err != nil {
return err
}
}
if v.TimeoutInSeconds != nil {
ok := object.Key("timeoutInSeconds")
ok.Integer(*v.TimeoutInSeconds)
}
if v.UpdateResponse != nil {
ok := object.Key("updateResponse")
if err := awsRestjson1_serializeDocumentFulfillmentUpdateResponseSpecification(v.UpdateResponse, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentGrammarSlotTypeSetting(v *types.GrammarSlotTypeSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Source != nil {
ok := object.Key("source")
if err := awsRestjson1_serializeDocumentGrammarSlotTypeSource(v.Source, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentGrammarSlotTypeSource(v *types.GrammarSlotTypeSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.S3ObjectKey != nil {
ok := object.Key("s3ObjectKey")
ok.String(*v.S3ObjectKey)
}
return nil
}
func awsRestjson1_serializeDocumentImageResponseCard(v *types.ImageResponseCard, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Buttons != nil {
ok := object.Key("buttons")
if err := awsRestjson1_serializeDocumentButtonsList(v.Buttons, ok); err != nil {
return err
}
}
if v.ImageUrl != nil {
ok := object.Key("imageUrl")
ok.String(*v.ImageUrl)
}
if v.Subtitle != nil {
ok := object.Key("subtitle")
ok.String(*v.Subtitle)
}
if v.Title != nil {
ok := object.Key("title")
ok.String(*v.Title)
}
return nil
}
func awsRestjson1_serializeDocumentImportFilter(v *types.ImportFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImportFilters(v []types.ImportFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentImportFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImportResourceSpecification(v *types.ImportResourceSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotImportSpecification != nil {
ok := object.Key("botImportSpecification")
if err := awsRestjson1_serializeDocumentBotImportSpecification(v.BotImportSpecification, ok); err != nil {
return err
}
}
if v.BotLocaleImportSpecification != nil {
ok := object.Key("botLocaleImportSpecification")
if err := awsRestjson1_serializeDocumentBotLocaleImportSpecification(v.BotLocaleImportSpecification, ok); err != nil {
return err
}
}
if v.CustomVocabularyImportSpecification != nil {
ok := object.Key("customVocabularyImportSpecification")
if err := awsRestjson1_serializeDocumentCustomVocabularyImportSpecification(v.CustomVocabularyImportSpecification, ok); err != nil {
return err
}
}
if v.TestSetImportResourceSpecification != nil {
ok := object.Key("testSetImportResourceSpecification")
if err := awsRestjson1_serializeDocumentTestSetImportResourceSpecification(v.TestSetImportResourceSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImportSortBy(v *types.ImportSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentInitialResponseSetting(v *types.InitialResponseSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeHook != nil {
ok := object.Key("codeHook")
if err := awsRestjson1_serializeDocumentDialogCodeHookInvocationSetting(v.CodeHook, ok); err != nil {
return err
}
}
if v.Conditional != nil {
ok := object.Key("conditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.Conditional, ok); err != nil {
return err
}
}
if v.InitialResponse != nil {
ok := object.Key("initialResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.InitialResponse, ok); err != nil {
return err
}
}
if v.NextStep != nil {
ok := object.Key("nextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.NextStep, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentInputContext(v *types.InputContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentInputContextsList(v []types.InputContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentInputContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentClosingSetting(v *types.IntentClosingSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.ClosingResponse != nil {
ok := object.Key("closingResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.ClosingResponse, ok); err != nil {
return err
}
}
if v.Conditional != nil {
ok := object.Key("conditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.Conditional, ok); err != nil {
return err
}
}
if v.NextStep != nil {
ok := object.Key("nextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.NextStep, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentConfirmationSetting(v *types.IntentConfirmationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.CodeHook != nil {
ok := object.Key("codeHook")
if err := awsRestjson1_serializeDocumentDialogCodeHookInvocationSetting(v.CodeHook, ok); err != nil {
return err
}
}
if v.ConfirmationConditional != nil {
ok := object.Key("confirmationConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.ConfirmationConditional, ok); err != nil {
return err
}
}
if v.ConfirmationNextStep != nil {
ok := object.Key("confirmationNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.ConfirmationNextStep, ok); err != nil {
return err
}
}
if v.ConfirmationResponse != nil {
ok := object.Key("confirmationResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.ConfirmationResponse, ok); err != nil {
return err
}
}
if v.DeclinationConditional != nil {
ok := object.Key("declinationConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.DeclinationConditional, ok); err != nil {
return err
}
}
if v.DeclinationNextStep != nil {
ok := object.Key("declinationNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.DeclinationNextStep, ok); err != nil {
return err
}
}
if v.DeclinationResponse != nil {
ok := object.Key("declinationResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.DeclinationResponse, ok); err != nil {
return err
}
}
if v.ElicitationCodeHook != nil {
ok := object.Key("elicitationCodeHook")
if err := awsRestjson1_serializeDocumentElicitationCodeHookInvocationSetting(v.ElicitationCodeHook, ok); err != nil {
return err
}
}
if v.FailureConditional != nil {
ok := object.Key("failureConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.FailureConditional, ok); err != nil {
return err
}
}
if v.FailureNextStep != nil {
ok := object.Key("failureNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.FailureNextStep, ok); err != nil {
return err
}
}
if v.FailureResponse != nil {
ok := object.Key("failureResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.FailureResponse, ok); err != nil {
return err
}
}
if v.PromptSpecification != nil {
ok := object.Key("promptSpecification")
if err := awsRestjson1_serializeDocumentPromptSpecification(v.PromptSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentFilter(v *types.IntentFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentFilters(v []types.IntentFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentIntentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentOverride(v *types.IntentOverride, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Slots != nil {
ok := object.Key("slots")
if err := awsRestjson1_serializeDocumentSlotValueOverrideMap(v.Slots, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentSortBy(v *types.IntentSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentKendraConfiguration(v *types.KendraConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KendraIndex != nil {
ok := object.Key("kendraIndex")
ok.String(*v.KendraIndex)
}
if v.QueryFilterString != nil {
ok := object.Key("queryFilterString")
ok.String(*v.QueryFilterString)
}
if v.QueryFilterStringEnabled {
ok := object.Key("queryFilterStringEnabled")
ok.Boolean(v.QueryFilterStringEnabled)
}
return nil
}
func awsRestjson1_serializeDocumentLambdaCodeHook(v *types.LambdaCodeHook, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeHookInterfaceVersion != nil {
ok := object.Key("codeHookInterfaceVersion")
ok.String(*v.CodeHookInterfaceVersion)
}
if v.LambdaARN != nil {
ok := object.Key("lambdaARN")
ok.String(*v.LambdaARN)
}
return nil
}
func awsRestjson1_serializeDocumentLexTranscriptFilter(v *types.LexTranscriptFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DateRangeFilter != nil {
ok := object.Key("dateRangeFilter")
if err := awsRestjson1_serializeDocumentDateRangeFilter(v.DateRangeFilter, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessage(v *types.Message, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomPayload != nil {
ok := object.Key("customPayload")
if err := awsRestjson1_serializeDocumentCustomPayload(v.CustomPayload, ok); err != nil {
return err
}
}
if v.ImageResponseCard != nil {
ok := object.Key("imageResponseCard")
if err := awsRestjson1_serializeDocumentImageResponseCard(v.ImageResponseCard, ok); err != nil {
return err
}
}
if v.PlainTextMessage != nil {
ok := object.Key("plainTextMessage")
if err := awsRestjson1_serializeDocumentPlainTextMessage(v.PlainTextMessage, ok); err != nil {
return err
}
}
if v.SsmlMessage != nil {
ok := object.Key("ssmlMessage")
if err := awsRestjson1_serializeDocumentSSMLMessage(v.SsmlMessage, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessageGroup(v *types.MessageGroup, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Message != nil {
ok := object.Key("message")
if err := awsRestjson1_serializeDocumentMessage(v.Message, ok); err != nil {
return err
}
}
if v.Variations != nil {
ok := object.Key("variations")
if err := awsRestjson1_serializeDocumentMessageVariationsList(v.Variations, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessageGroupsList(v []types.MessageGroup, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMessageGroup(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessageVariationsList(v []types.Message, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMessage(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMultipleValuesSetting(v *types.MultipleValuesSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowMultipleValues {
ok := object.Key("allowMultipleValues")
ok.Boolean(v.AllowMultipleValues)
}
return nil
}
func awsRestjson1_serializeDocumentNewCustomVocabularyItem(v *types.NewCustomVocabularyItem, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DisplayAs != nil {
ok := object.Key("displayAs")
ok.String(*v.DisplayAs)
}
if v.Phrase != nil {
ok := object.Key("phrase")
ok.String(*v.Phrase)
}
if v.Weight != nil {
ok := object.Key("weight")
ok.Integer(*v.Weight)
}
return nil
}
func awsRestjson1_serializeDocumentObfuscationSetting(v *types.ObfuscationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ObfuscationSettingType) > 0 {
ok := object.Key("obfuscationSettingType")
ok.String(string(v.ObfuscationSettingType))
}
return nil
}
func awsRestjson1_serializeDocumentObjectPrefixes(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentOperationList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentOutputContext(v *types.OutputContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.TimeToLiveInSeconds != nil {
ok := object.Key("timeToLiveInSeconds")
ok.Integer(*v.TimeToLiveInSeconds)
}
if v.TurnsToLive != nil {
ok := object.Key("turnsToLive")
ok.Integer(*v.TurnsToLive)
}
return nil
}
func awsRestjson1_serializeDocumentOutputContextsList(v []types.OutputContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentOutputContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPathFormat(v *types.PathFormat, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ObjectPrefixes != nil {
ok := object.Key("objectPrefixes")
if err := awsRestjson1_serializeDocumentObjectPrefixes(v.ObjectPrefixes, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPlainTextMessage(v *types.PlainTextMessage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentPostDialogCodeHookInvocationSpecification(v *types.PostDialogCodeHookInvocationSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureConditional != nil {
ok := object.Key("failureConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.FailureConditional, ok); err != nil {
return err
}
}
if v.FailureNextStep != nil {
ok := object.Key("failureNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.FailureNextStep, ok); err != nil {
return err
}
}
if v.FailureResponse != nil {
ok := object.Key("failureResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.FailureResponse, ok); err != nil {
return err
}
}
if v.SuccessConditional != nil {
ok := object.Key("successConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.SuccessConditional, ok); err != nil {
return err
}
}
if v.SuccessNextStep != nil {
ok := object.Key("successNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.SuccessNextStep, ok); err != nil {
return err
}
}
if v.SuccessResponse != nil {
ok := object.Key("successResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.SuccessResponse, ok); err != nil {
return err
}
}
if v.TimeoutConditional != nil {
ok := object.Key("timeoutConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.TimeoutConditional, ok); err != nil {
return err
}
}
if v.TimeoutNextStep != nil {
ok := object.Key("timeoutNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.TimeoutNextStep, ok); err != nil {
return err
}
}
if v.TimeoutResponse != nil {
ok := object.Key("timeoutResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.TimeoutResponse, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPostFulfillmentStatusSpecification(v *types.PostFulfillmentStatusSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureConditional != nil {
ok := object.Key("failureConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.FailureConditional, ok); err != nil {
return err
}
}
if v.FailureNextStep != nil {
ok := object.Key("failureNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.FailureNextStep, ok); err != nil {
return err
}
}
if v.FailureResponse != nil {
ok := object.Key("failureResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.FailureResponse, ok); err != nil {
return err
}
}
if v.SuccessConditional != nil {
ok := object.Key("successConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.SuccessConditional, ok); err != nil {
return err
}
}
if v.SuccessNextStep != nil {
ok := object.Key("successNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.SuccessNextStep, ok); err != nil {
return err
}
}
if v.SuccessResponse != nil {
ok := object.Key("successResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.SuccessResponse, ok); err != nil {
return err
}
}
if v.TimeoutConditional != nil {
ok := object.Key("timeoutConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.TimeoutConditional, ok); err != nil {
return err
}
}
if v.TimeoutNextStep != nil {
ok := object.Key("timeoutNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.TimeoutNextStep, ok); err != nil {
return err
}
}
if v.TimeoutResponse != nil {
ok := object.Key("timeoutResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.TimeoutResponse, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPrincipal(v *types.Principal, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
if v.Service != nil {
ok := object.Key("service")
ok.String(*v.Service)
}
return nil
}
func awsRestjson1_serializeDocumentPrincipalList(v []types.Principal, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentPrincipal(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPromptAttemptSpecification(v *types.PromptAttemptSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedInputTypes != nil {
ok := object.Key("allowedInputTypes")
if err := awsRestjson1_serializeDocumentAllowedInputTypes(v.AllowedInputTypes, ok); err != nil {
return err
}
}
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.AudioAndDTMFInputSpecification != nil {
ok := object.Key("audioAndDTMFInputSpecification")
if err := awsRestjson1_serializeDocumentAudioAndDTMFInputSpecification(v.AudioAndDTMFInputSpecification, ok); err != nil {
return err
}
}
if v.TextInputSpecification != nil {
ok := object.Key("textInputSpecification")
if err := awsRestjson1_serializeDocumentTextInputSpecification(v.TextInputSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPromptAttemptsSpecificationMap(v map[string]types.PromptAttemptSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentPromptAttemptSpecification(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPromptSpecification(v *types.PromptSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.MaxRetries != nil {
ok := object.Key("maxRetries")
ok.Integer(*v.MaxRetries)
}
if v.MessageGroups != nil {
ok := object.Key("messageGroups")
if err := awsRestjson1_serializeDocumentMessageGroupsList(v.MessageGroups, ok); err != nil {
return err
}
}
if len(v.MessageSelectionStrategy) > 0 {
ok := object.Key("messageSelectionStrategy")
ok.String(string(v.MessageSelectionStrategy))
}
if v.PromptAttemptsSpecification != nil {
ok := object.Key("promptAttemptsSpecification")
if err := awsRestjson1_serializeDocumentPromptAttemptsSpecificationMap(v.PromptAttemptsSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRelativeAggregationDuration(v *types.RelativeAggregationDuration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.TimeDimension) > 0 {
ok := object.Key("timeDimension")
ok.String(string(v.TimeDimension))
}
{
ok := object.Key("timeValue")
ok.Integer(v.TimeValue)
}
return nil
}
func awsRestjson1_serializeDocumentResponseSpecification(v *types.ResponseSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.MessageGroups != nil {
ok := object.Key("messageGroups")
if err := awsRestjson1_serializeDocumentMessageGroupsList(v.MessageGroups, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentS3BucketLogDestination(v *types.S3BucketLogDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if v.LogPrefix != nil {
ok := object.Key("logPrefix")
ok.String(*v.LogPrefix)
}
if v.S3BucketArn != nil {
ok := object.Key("s3BucketArn")
ok.String(*v.S3BucketArn)
}
return nil
}
func awsRestjson1_serializeDocumentS3BucketTranscriptSource(v *types.S3BucketTranscriptSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if v.PathFormat != nil {
ok := object.Key("pathFormat")
if err := awsRestjson1_serializeDocumentPathFormat(v.PathFormat, ok); err != nil {
return err
}
}
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.TranscriptFilter != nil {
ok := object.Key("transcriptFilter")
if err := awsRestjson1_serializeDocumentTranscriptFilter(v.TranscriptFilter, ok); err != nil {
return err
}
}
if len(v.TranscriptFormat) > 0 {
ok := object.Key("transcriptFormat")
ok.String(string(v.TranscriptFormat))
}
return nil
}
func awsRestjson1_serializeDocumentSampleUtterance(v *types.SampleUtterance, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Utterance != nil {
ok := object.Key("utterance")
ok.String(*v.Utterance)
}
return nil
}
func awsRestjson1_serializeDocumentSampleUtterancesList(v []types.SampleUtterance, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSampleUtterance(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSampleValue(v *types.SampleValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentSentimentAnalysisSettings(v *types.SentimentAnalysisSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("detectSentiment")
ok.Boolean(v.DetectSentiment)
}
return nil
}
func awsRestjson1_serializeDocumentSlotCaptureSetting(v *types.SlotCaptureSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CaptureConditional != nil {
ok := object.Key("captureConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.CaptureConditional, ok); err != nil {
return err
}
}
if v.CaptureNextStep != nil {
ok := object.Key("captureNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.CaptureNextStep, ok); err != nil {
return err
}
}
if v.CaptureResponse != nil {
ok := object.Key("captureResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.CaptureResponse, ok); err != nil {
return err
}
}
if v.CodeHook != nil {
ok := object.Key("codeHook")
if err := awsRestjson1_serializeDocumentDialogCodeHookInvocationSetting(v.CodeHook, ok); err != nil {
return err
}
}
if v.ElicitationCodeHook != nil {
ok := object.Key("elicitationCodeHook")
if err := awsRestjson1_serializeDocumentElicitationCodeHookInvocationSetting(v.ElicitationCodeHook, ok); err != nil {
return err
}
}
if v.FailureConditional != nil {
ok := object.Key("failureConditional")
if err := awsRestjson1_serializeDocumentConditionalSpecification(v.FailureConditional, ok); err != nil {
return err
}
}
if v.FailureNextStep != nil {
ok := object.Key("failureNextStep")
if err := awsRestjson1_serializeDocumentDialogState(v.FailureNextStep, ok); err != nil {
return err
}
}
if v.FailureResponse != nil {
ok := object.Key("failureResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.FailureResponse, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValue(v *types.SlotDefaultValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValue != nil {
ok := object.Key("defaultValue")
ok.String(*v.DefaultValue)
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValueList(v []types.SlotDefaultValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotDefaultValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValueSpecification(v *types.SlotDefaultValueSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValueList != nil {
ok := object.Key("defaultValueList")
if err := awsRestjson1_serializeDocumentSlotDefaultValueList(v.DefaultValueList, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotFilter(v *types.SlotFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotFilters(v []types.SlotFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotPrioritiesList(v []types.SlotPriority, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotPriority(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotPriority(v *types.SlotPriority, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Priority != nil {
ok := object.Key("priority")
ok.Integer(*v.Priority)
}
if v.SlotId != nil {
ok := object.Key("slotId")
ok.String(*v.SlotId)
}
return nil
}
func awsRestjson1_serializeDocumentSlotSortBy(v *types.SlotSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeFilter(v *types.SlotTypeFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if len(v.Operator) > 0 {
ok := object.Key("operator")
ok.String(string(v.Operator))
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeFilters(v []types.SlotTypeFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotTypeFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeSortBy(v *types.SlotTypeSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeValue(v *types.SlotTypeValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SampleValue != nil {
ok := object.Key("sampleValue")
if err := awsRestjson1_serializeDocumentSampleValue(v.SampleValue, ok); err != nil {
return err
}
}
if v.Synonyms != nil {
ok := object.Key("synonyms")
if err := awsRestjson1_serializeDocumentSynonymList(v.Synonyms, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeValues(v []types.SlotTypeValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotTypeValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotValue(v *types.SlotValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InterpretedValue != nil {
ok := object.Key("interpretedValue")
ok.String(*v.InterpretedValue)
}
return nil
}
func awsRestjson1_serializeDocumentSlotValueElicitationSetting(v *types.SlotValueElicitationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValueSpecification != nil {
ok := object.Key("defaultValueSpecification")
if err := awsRestjson1_serializeDocumentSlotDefaultValueSpecification(v.DefaultValueSpecification, ok); err != nil {
return err
}
}
if v.PromptSpecification != nil {
ok := object.Key("promptSpecification")
if err := awsRestjson1_serializeDocumentPromptSpecification(v.PromptSpecification, ok); err != nil {
return err
}
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentSampleUtterancesList(v.SampleUtterances, ok); err != nil {
return err
}
}
if v.SlotCaptureSetting != nil {
ok := object.Key("slotCaptureSetting")
if err := awsRestjson1_serializeDocumentSlotCaptureSetting(v.SlotCaptureSetting, ok); err != nil {
return err
}
}
if len(v.SlotConstraint) > 0 {
ok := object.Key("slotConstraint")
ok.String(string(v.SlotConstraint))
}
if v.WaitAndContinueSpecification != nil {
ok := object.Key("waitAndContinueSpecification")
if err := awsRestjson1_serializeDocumentWaitAndContinueSpecification(v.WaitAndContinueSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotValueOverride(v *types.SlotValueOverride, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Shape) > 0 {
ok := object.Key("shape")
ok.String(string(v.Shape))
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentSlotValue(v.Value, ok); err != nil {
return err
}
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentSlotValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotValueOverrideMap(v map[string]types.SlotValueOverride, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentSlotValueOverride(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotValueRegexFilter(v *types.SlotValueRegexFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Pattern != nil {
ok := object.Key("pattern")
ok.String(*v.Pattern)
}
return nil
}
func awsRestjson1_serializeDocumentSlotValues(v []types.SlotValueOverride, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotValueOverride(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotValueSelectionSetting(v *types.SlotValueSelectionSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdvancedRecognitionSetting != nil {
ok := object.Key("advancedRecognitionSetting")
if err := awsRestjson1_serializeDocumentAdvancedRecognitionSetting(v.AdvancedRecognitionSetting, ok); err != nil {
return err
}
}
if v.RegexFilter != nil {
ok := object.Key("regexFilter")
if err := awsRestjson1_serializeDocumentSlotValueRegexFilter(v.RegexFilter, ok); err != nil {
return err
}
}
if len(v.ResolutionStrategy) > 0 {
ok := object.Key("resolutionStrategy")
ok.String(string(v.ResolutionStrategy))
}
return nil
}
func awsRestjson1_serializeDocumentSpecifications(v *types.Specifications, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SlotTypeId != nil {
ok := object.Key("slotTypeId")
ok.String(*v.SlotTypeId)
}
if v.ValueElicitationSetting != nil {
ok := object.Key("valueElicitationSetting")
if err := awsRestjson1_serializeDocumentSubSlotValueElicitationSetting(v.ValueElicitationSetting, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSSMLMessage(v *types.SSMLMessage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentStillWaitingResponseSpecification(v *types.StillWaitingResponseSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowInterrupt != nil {
ok := object.Key("allowInterrupt")
ok.Boolean(*v.AllowInterrupt)
}
if v.FrequencyInSeconds != nil {
ok := object.Key("frequencyInSeconds")
ok.Integer(*v.FrequencyInSeconds)
}
if v.MessageGroups != nil {
ok := object.Key("messageGroups")
if err := awsRestjson1_serializeDocumentMessageGroupsList(v.MessageGroups, ok); err != nil {
return err
}
}
if v.TimeoutInSeconds != nil {
ok := object.Key("timeoutInSeconds")
ok.Integer(*v.TimeoutInSeconds)
}
return nil
}
func awsRestjson1_serializeDocumentStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentSubSlotSetting(v *types.SubSlotSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expression != nil {
ok := object.Key("expression")
ok.String(*v.Expression)
}
if v.SlotSpecifications != nil {
ok := object.Key("slotSpecifications")
if err := awsRestjson1_serializeDocumentSubSlotSpecificationMap(v.SlotSpecifications, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSubSlotSpecificationMap(v map[string]types.Specifications, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentSpecifications(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSubSlotTypeComposition(v *types.SubSlotTypeComposition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.SlotTypeId != nil {
ok := object.Key("slotTypeId")
ok.String(*v.SlotTypeId)
}
return nil
}
func awsRestjson1_serializeDocumentSubSlotTypeList(v []types.SubSlotTypeComposition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSubSlotTypeComposition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSubSlotValueElicitationSetting(v *types.SubSlotValueElicitationSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValueSpecification != nil {
ok := object.Key("defaultValueSpecification")
if err := awsRestjson1_serializeDocumentSlotDefaultValueSpecification(v.DefaultValueSpecification, ok); err != nil {
return err
}
}
if v.PromptSpecification != nil {
ok := object.Key("promptSpecification")
if err := awsRestjson1_serializeDocumentPromptSpecification(v.PromptSpecification, ok); err != nil {
return err
}
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentSampleUtterancesList(v.SampleUtterances, ok); err != nil {
return err
}
}
if v.WaitAndContinueSpecification != nil {
ok := object.Key("waitAndContinueSpecification")
if err := awsRestjson1_serializeDocumentWaitAndContinueSpecification(v.WaitAndContinueSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSynonymList(v []types.SampleValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSampleValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTestExecutionResultFilterBy(v *types.TestExecutionResultFilterBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConversationLevelTestResultsFilterBy != nil {
ok := object.Key("conversationLevelTestResultsFilterBy")
if err := awsRestjson1_serializeDocumentConversationLevelTestResultsFilterBy(v.ConversationLevelTestResultsFilterBy, ok); err != nil {
return err
}
}
if len(v.ResultTypeFilter) > 0 {
ok := object.Key("resultTypeFilter")
ok.String(string(v.ResultTypeFilter))
}
return nil
}
func awsRestjson1_serializeDocumentTestExecutionSortBy(v *types.TestExecutionSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentTestExecutionTarget(v *types.TestExecutionTarget, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasTarget != nil {
ok := object.Key("botAliasTarget")
if err := awsRestjson1_serializeDocumentBotAliasTestExecutionTarget(v.BotAliasTarget, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTestSetDiscrepancyReportBotAliasTarget(v *types.TestSetDiscrepancyReportBotAliasTarget, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasId != nil {
ok := object.Key("botAliasId")
ok.String(*v.BotAliasId)
}
if v.BotId != nil {
ok := object.Key("botId")
ok.String(*v.BotId)
}
if v.LocaleId != nil {
ok := object.Key("localeId")
ok.String(*v.LocaleId)
}
return nil
}
func awsRestjson1_serializeDocumentTestSetDiscrepancyReportResourceTarget(v *types.TestSetDiscrepancyReportResourceTarget, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotAliasTarget != nil {
ok := object.Key("botAliasTarget")
if err := awsRestjson1_serializeDocumentTestSetDiscrepancyReportBotAliasTarget(v.BotAliasTarget, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTestSetExportSpecification(v *types.TestSetExportSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TestSetId != nil {
ok := object.Key("testSetId")
ok.String(*v.TestSetId)
}
return nil
}
func awsRestjson1_serializeDocumentTestSetGenerationDataSource(v *types.TestSetGenerationDataSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConversationLogsDataSource != nil {
ok := object.Key("conversationLogsDataSource")
if err := awsRestjson1_serializeDocumentConversationLogsDataSource(v.ConversationLogsDataSource, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTestSetImportInputLocation(v *types.TestSetImportInputLocation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.S3Path != nil {
ok := object.Key("s3Path")
ok.String(*v.S3Path)
}
return nil
}
func awsRestjson1_serializeDocumentTestSetImportResourceSpecification(v *types.TestSetImportResourceSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.ImportInputLocation != nil {
ok := object.Key("importInputLocation")
if err := awsRestjson1_serializeDocumentTestSetImportInputLocation(v.ImportInputLocation, ok); err != nil {
return err
}
}
if len(v.Modality) > 0 {
ok := object.Key("modality")
ok.String(string(v.Modality))
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.StorageLocation != nil {
ok := object.Key("storageLocation")
if err := awsRestjson1_serializeDocumentTestSetStorageLocation(v.StorageLocation, ok); err != nil {
return err
}
}
if v.TestSetName != nil {
ok := object.Key("testSetName")
ok.String(*v.TestSetName)
}
if v.TestSetTags != nil {
ok := object.Key("testSetTags")
if err := awsRestjson1_serializeDocumentTagMap(v.TestSetTags, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTestSetSortBy(v *types.TestSetSortBy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Attribute) > 0 {
ok := object.Key("attribute")
ok.String(string(v.Attribute))
}
if len(v.Order) > 0 {
ok := object.Key("order")
ok.String(string(v.Order))
}
return nil
}
func awsRestjson1_serializeDocumentTestSetStorageLocation(v *types.TestSetStorageLocation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.S3Path != nil {
ok := object.Key("s3Path")
ok.String(*v.S3Path)
}
return nil
}
func awsRestjson1_serializeDocumentTextInputSpecification(v *types.TextInputSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StartTimeoutMs != nil {
ok := object.Key("startTimeoutMs")
ok.Integer(*v.StartTimeoutMs)
}
return nil
}
func awsRestjson1_serializeDocumentTextLogDestination(v *types.TextLogDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatch != nil {
ok := object.Key("cloudWatch")
if err := awsRestjson1_serializeDocumentCloudWatchLogGroupLogDestination(v.CloudWatch, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTextLogSetting(v *types.TextLogSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("destination")
if err := awsRestjson1_serializeDocumentTextLogDestination(v.Destination, ok); err != nil {
return err
}
}
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
return nil
}
func awsRestjson1_serializeDocumentTextLogSettingsList(v []types.TextLogSetting, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTextLogSetting(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTranscriptFilter(v *types.TranscriptFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LexTranscriptFilter != nil {
ok := object.Key("lexTranscriptFilter")
if err := awsRestjson1_serializeDocumentLexTranscriptFilter(v.LexTranscriptFilter, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTranscriptSourceSetting(v *types.TranscriptSourceSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3BucketTranscriptSource != nil {
ok := object.Key("s3BucketTranscriptSource")
if err := awsRestjson1_serializeDocumentS3BucketTranscriptSource(v.S3BucketTranscriptSource, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUpdateCustomVocabularyItemsList(v []types.CustomVocabularyItem, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentCustomVocabularyItem(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUtteranceAggregationDuration(v *types.UtteranceAggregationDuration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelativeAggregationDuration != nil {
ok := object.Key("relativeAggregationDuration")
if err := awsRestjson1_serializeDocumentRelativeAggregationDuration(v.RelativeAggregationDuration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentVoiceSettings(v *types.VoiceSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Engine) > 0 {
ok := object.Key("engine")
ok.String(string(v.Engine))
}
if v.VoiceId != nil {
ok := object.Key("voiceId")
ok.String(*v.VoiceId)
}
return nil
}
func awsRestjson1_serializeDocumentWaitAndContinueSpecification(v *types.WaitAndContinueSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Active != nil {
ok := object.Key("active")
ok.Boolean(*v.Active)
}
if v.ContinueResponse != nil {
ok := object.Key("continueResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.ContinueResponse, ok); err != nil {
return err
}
}
if v.StillWaitingResponse != nil {
ok := object.Key("stillWaitingResponse")
if err := awsRestjson1_serializeDocumentStillWaitingResponseSpecification(v.StillWaitingResponse, ok); err != nil {
return err
}
}
if v.WaitingResponse != nil {
ok := object.Key("waitingResponse")
if err := awsRestjson1_serializeDocumentResponseSpecification(v.WaitingResponse, ok); err != nil {
return err
}
}
return nil
}
| 11,282 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpBatchCreateCustomVocabularyItem struct {
}
func (*validateOpBatchCreateCustomVocabularyItem) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchCreateCustomVocabularyItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchCreateCustomVocabularyItemInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchCreateCustomVocabularyItemInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchDeleteCustomVocabularyItem struct {
}
func (*validateOpBatchDeleteCustomVocabularyItem) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchDeleteCustomVocabularyItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchDeleteCustomVocabularyItemInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchDeleteCustomVocabularyItemInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchUpdateCustomVocabularyItem struct {
}
func (*validateOpBatchUpdateCustomVocabularyItem) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchUpdateCustomVocabularyItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchUpdateCustomVocabularyItemInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchUpdateCustomVocabularyItemInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBuildBotLocale struct {
}
func (*validateOpBuildBotLocale) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBuildBotLocale) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BuildBotLocaleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBuildBotLocaleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBotAlias struct {
}
func (*validateOpCreateBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBot struct {
}
func (*validateOpCreateBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBotLocale struct {
}
func (*validateOpCreateBotLocale) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBotLocale) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBotLocaleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBotLocaleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBotVersion struct {
}
func (*validateOpCreateBotVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBotVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBotVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBotVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateExport struct {
}
func (*validateOpCreateExport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateExportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateExportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateIntent struct {
}
func (*validateOpCreateIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateResourcePolicy struct {
}
func (*validateOpCreateResourcePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateResourcePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateResourcePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateResourcePolicyStatement struct {
}
func (*validateOpCreateResourcePolicyStatement) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateResourcePolicyStatement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateResourcePolicyStatementInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateResourcePolicyStatementInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSlot struct {
}
func (*validateOpCreateSlot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSlot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSlotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSlotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSlotType struct {
}
func (*validateOpCreateSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateTestSetDiscrepancyReport struct {
}
func (*validateOpCreateTestSetDiscrepancyReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateTestSetDiscrepancyReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTestSetDiscrepancyReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTestSetDiscrepancyReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotAlias struct {
}
func (*validateOpDeleteBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBot struct {
}
func (*validateOpDeleteBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotLocale struct {
}
func (*validateOpDeleteBotLocale) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotLocale) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotLocaleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotLocaleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotVersion struct {
}
func (*validateOpDeleteBotVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCustomVocabulary struct {
}
func (*validateOpDeleteCustomVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCustomVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCustomVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCustomVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteExport struct {
}
func (*validateOpDeleteExport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteExportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteExportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteImport struct {
}
func (*validateOpDeleteImport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteImportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteImportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteIntent struct {
}
func (*validateOpDeleteIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteResourcePolicy struct {
}
func (*validateOpDeleteResourcePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteResourcePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteResourcePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteResourcePolicyStatement struct {
}
func (*validateOpDeleteResourcePolicyStatement) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteResourcePolicyStatement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteResourcePolicyStatementInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteResourcePolicyStatementInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlot struct {
}
func (*validateOpDeleteSlot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlotType struct {
}
func (*validateOpDeleteSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTestSet struct {
}
func (*validateOpDeleteTestSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTestSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTestSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTestSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteUtterances struct {
}
func (*validateOpDeleteUtterances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteUtterances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteUtterancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteUtterancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBotAlias struct {
}
func (*validateOpDescribeBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBot struct {
}
func (*validateOpDescribeBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBotLocale struct {
}
func (*validateOpDescribeBotLocale) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBotLocale) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBotLocaleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBotLocaleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBotRecommendation struct {
}
func (*validateOpDescribeBotRecommendation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBotRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBotRecommendationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBotRecommendationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBotVersion struct {
}
func (*validateOpDescribeBotVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBotVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBotVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBotVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCustomVocabularyMetadata struct {
}
func (*validateOpDescribeCustomVocabularyMetadata) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCustomVocabularyMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCustomVocabularyMetadataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCustomVocabularyMetadataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeExport struct {
}
func (*validateOpDescribeExport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeExportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeExportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeImport struct {
}
func (*validateOpDescribeImport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeImportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeImportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeIntent struct {
}
func (*validateOpDescribeIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeResourcePolicy struct {
}
func (*validateOpDescribeResourcePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeResourcePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeResourcePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSlot struct {
}
func (*validateOpDescribeSlot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSlot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSlotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSlotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSlotType struct {
}
func (*validateOpDescribeSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTestExecution struct {
}
func (*validateOpDescribeTestExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTestExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTestExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTestExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTestSetDiscrepancyReport struct {
}
func (*validateOpDescribeTestSetDiscrepancyReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTestSetDiscrepancyReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTestSetDiscrepancyReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTestSetDiscrepancyReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTestSetGeneration struct {
}
func (*validateOpDescribeTestSetGeneration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTestSetGeneration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTestSetGenerationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTestSetGenerationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTestSet struct {
}
func (*validateOpDescribeTestSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTestSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTestSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTestSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetTestExecutionArtifactsUrl struct {
}
func (*validateOpGetTestExecutionArtifactsUrl) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetTestExecutionArtifactsUrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetTestExecutionArtifactsUrlInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetTestExecutionArtifactsUrlInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAggregatedUtterances struct {
}
func (*validateOpListAggregatedUtterances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAggregatedUtterances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAggregatedUtterancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAggregatedUtterancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBotAliases struct {
}
func (*validateOpListBotAliases) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBotAliases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBotAliasesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBotAliasesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBotLocales struct {
}
func (*validateOpListBotLocales) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBotLocales) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBotLocalesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBotLocalesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBotRecommendations struct {
}
func (*validateOpListBotRecommendations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBotRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBotRecommendationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBotRecommendationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBots struct {
}
func (*validateOpListBots) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBotsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBotsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBotVersions struct {
}
func (*validateOpListBotVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBotVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBotVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBotVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBuiltInIntents struct {
}
func (*validateOpListBuiltInIntents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBuiltInIntents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBuiltInIntentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBuiltInIntentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBuiltInSlotTypes struct {
}
func (*validateOpListBuiltInSlotTypes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBuiltInSlotTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBuiltInSlotTypesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBuiltInSlotTypesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListCustomVocabularyItems struct {
}
func (*validateOpListCustomVocabularyItems) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListCustomVocabularyItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListCustomVocabularyItemsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListCustomVocabularyItemsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListExports struct {
}
func (*validateOpListExports) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListExports) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListExportsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListExportsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListImports struct {
}
func (*validateOpListImports) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListImports) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListImportsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListImportsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListIntents struct {
}
func (*validateOpListIntents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListIntents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListIntentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListIntentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListRecommendedIntents struct {
}
func (*validateOpListRecommendedIntents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListRecommendedIntents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListRecommendedIntentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListRecommendedIntentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSlots struct {
}
func (*validateOpListSlots) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSlots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListSlotsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListSlotsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSlotTypes struct {
}
func (*validateOpListSlotTypes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSlotTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListSlotTypesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListSlotTypesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTestExecutionResultItems struct {
}
func (*validateOpListTestExecutionResultItems) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTestExecutionResultItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTestExecutionResultItemsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTestExecutionResultItemsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTestExecutions struct {
}
func (*validateOpListTestExecutions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTestExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTestExecutionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTestExecutionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTestSetRecords struct {
}
func (*validateOpListTestSetRecords) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTestSetRecords) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTestSetRecordsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTestSetRecordsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTestSets struct {
}
func (*validateOpListTestSets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTestSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTestSetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTestSetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchAssociatedTranscripts struct {
}
func (*validateOpSearchAssociatedTranscripts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchAssociatedTranscripts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchAssociatedTranscriptsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchAssociatedTranscriptsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartBotRecommendation struct {
}
func (*validateOpStartBotRecommendation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartBotRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartBotRecommendationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartBotRecommendationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartImport struct {
}
func (*validateOpStartImport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartImportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartImportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartTestExecution struct {
}
func (*validateOpStartTestExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartTestExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartTestExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartTestExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartTestSetGeneration struct {
}
func (*validateOpStartTestSetGeneration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartTestSetGeneration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartTestSetGenerationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartTestSetGenerationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopBotRecommendation struct {
}
func (*validateOpStopBotRecommendation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopBotRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopBotRecommendationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopBotRecommendationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBotAlias struct {
}
func (*validateOpUpdateBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBot struct {
}
func (*validateOpUpdateBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBotLocale struct {
}
func (*validateOpUpdateBotLocale) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBotLocale) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBotLocaleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBotLocaleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBotRecommendation struct {
}
func (*validateOpUpdateBotRecommendation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBotRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBotRecommendationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBotRecommendationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateExport struct {
}
func (*validateOpUpdateExport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateExportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateExportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateIntent struct {
}
func (*validateOpUpdateIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateResourcePolicy struct {
}
func (*validateOpUpdateResourcePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateResourcePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateResourcePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSlot struct {
}
func (*validateOpUpdateSlot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSlot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSlotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSlotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSlotType struct {
}
func (*validateOpUpdateSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateTestSet struct {
}
func (*validateOpUpdateTestSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateTestSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateTestSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateTestSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpBatchCreateCustomVocabularyItemValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchCreateCustomVocabularyItem{}, middleware.After)
}
func addOpBatchDeleteCustomVocabularyItemValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchDeleteCustomVocabularyItem{}, middleware.After)
}
func addOpBatchUpdateCustomVocabularyItemValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchUpdateCustomVocabularyItem{}, middleware.After)
}
func addOpBuildBotLocaleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBuildBotLocale{}, middleware.After)
}
func addOpCreateBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBotAlias{}, middleware.After)
}
func addOpCreateBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBot{}, middleware.After)
}
func addOpCreateBotLocaleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBotLocale{}, middleware.After)
}
func addOpCreateBotVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBotVersion{}, middleware.After)
}
func addOpCreateExportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateExport{}, middleware.After)
}
func addOpCreateIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateIntent{}, middleware.After)
}
func addOpCreateResourcePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateResourcePolicy{}, middleware.After)
}
func addOpCreateResourcePolicyStatementValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateResourcePolicyStatement{}, middleware.After)
}
func addOpCreateSlotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSlot{}, middleware.After)
}
func addOpCreateSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSlotType{}, middleware.After)
}
func addOpCreateTestSetDiscrepancyReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateTestSetDiscrepancyReport{}, middleware.After)
}
func addOpDeleteBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotAlias{}, middleware.After)
}
func addOpDeleteBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBot{}, middleware.After)
}
func addOpDeleteBotLocaleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotLocale{}, middleware.After)
}
func addOpDeleteBotVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotVersion{}, middleware.After)
}
func addOpDeleteCustomVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCustomVocabulary{}, middleware.After)
}
func addOpDeleteExportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteExport{}, middleware.After)
}
func addOpDeleteImportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteImport{}, middleware.After)
}
func addOpDeleteIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteIntent{}, middleware.After)
}
func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After)
}
func addOpDeleteResourcePolicyStatementValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteResourcePolicyStatement{}, middleware.After)
}
func addOpDeleteSlotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlot{}, middleware.After)
}
func addOpDeleteSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlotType{}, middleware.After)
}
func addOpDeleteTestSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTestSet{}, middleware.After)
}
func addOpDeleteUtterancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteUtterances{}, middleware.After)
}
func addOpDescribeBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBotAlias{}, middleware.After)
}
func addOpDescribeBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBot{}, middleware.After)
}
func addOpDescribeBotLocaleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBotLocale{}, middleware.After)
}
func addOpDescribeBotRecommendationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBotRecommendation{}, middleware.After)
}
func addOpDescribeBotVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBotVersion{}, middleware.After)
}
func addOpDescribeCustomVocabularyMetadataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCustomVocabularyMetadata{}, middleware.After)
}
func addOpDescribeExportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeExport{}, middleware.After)
}
func addOpDescribeImportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeImport{}, middleware.After)
}
func addOpDescribeIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeIntent{}, middleware.After)
}
func addOpDescribeResourcePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeResourcePolicy{}, middleware.After)
}
func addOpDescribeSlotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSlot{}, middleware.After)
}
func addOpDescribeSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSlotType{}, middleware.After)
}
func addOpDescribeTestExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTestExecution{}, middleware.After)
}
func addOpDescribeTestSetDiscrepancyReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTestSetDiscrepancyReport{}, middleware.After)
}
func addOpDescribeTestSetGenerationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTestSetGeneration{}, middleware.After)
}
func addOpDescribeTestSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTestSet{}, middleware.After)
}
func addOpGetTestExecutionArtifactsUrlValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetTestExecutionArtifactsUrl{}, middleware.After)
}
func addOpListAggregatedUtterancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAggregatedUtterances{}, middleware.After)
}
func addOpListBotAliasesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBotAliases{}, middleware.After)
}
func addOpListBotLocalesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBotLocales{}, middleware.After)
}
func addOpListBotRecommendationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBotRecommendations{}, middleware.After)
}
func addOpListBotsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBots{}, middleware.After)
}
func addOpListBotVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBotVersions{}, middleware.After)
}
func addOpListBuiltInIntentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBuiltInIntents{}, middleware.After)
}
func addOpListBuiltInSlotTypesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBuiltInSlotTypes{}, middleware.After)
}
func addOpListCustomVocabularyItemsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListCustomVocabularyItems{}, middleware.After)
}
func addOpListExportsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListExports{}, middleware.After)
}
func addOpListImportsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListImports{}, middleware.After)
}
func addOpListIntentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListIntents{}, middleware.After)
}
func addOpListRecommendedIntentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListRecommendedIntents{}, middleware.After)
}
func addOpListSlotsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSlots{}, middleware.After)
}
func addOpListSlotTypesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSlotTypes{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListTestExecutionResultItemsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTestExecutionResultItems{}, middleware.After)
}
func addOpListTestExecutionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTestExecutions{}, middleware.After)
}
func addOpListTestSetRecordsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTestSetRecords{}, middleware.After)
}
func addOpListTestSetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTestSets{}, middleware.After)
}
func addOpSearchAssociatedTranscriptsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchAssociatedTranscripts{}, middleware.After)
}
func addOpStartBotRecommendationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartBotRecommendation{}, middleware.After)
}
func addOpStartImportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartImport{}, middleware.After)
}
func addOpStartTestExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartTestExecution{}, middleware.After)
}
func addOpStartTestSetGenerationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartTestSetGeneration{}, middleware.After)
}
func addOpStopBotRecommendationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopBotRecommendation{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBotAlias{}, middleware.After)
}
func addOpUpdateBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBot{}, middleware.After)
}
func addOpUpdateBotLocaleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBotLocale{}, middleware.After)
}
func addOpUpdateBotRecommendationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBotRecommendation{}, middleware.After)
}
func addOpUpdateExportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateExport{}, middleware.After)
}
func addOpUpdateIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateIntent{}, middleware.After)
}
func addOpUpdateResourcePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateResourcePolicy{}, middleware.After)
}
func addOpUpdateSlotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSlot{}, middleware.After)
}
func addOpUpdateSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSlotType{}, middleware.After)
}
func addOpUpdateTestSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateTestSet{}, middleware.After)
}
func validateAggregatedUtterancesFilter(v *types.AggregatedUtterancesFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AggregatedUtterancesFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAggregatedUtterancesFilters(v []types.AggregatedUtterancesFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AggregatedUtterancesFilters"}
for i := range v {
if err := validateAggregatedUtterancesFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAggregatedUtterancesSortBy(v *types.AggregatedUtterancesSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AggregatedUtterancesSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAllowedInputTypes(v *types.AllowedInputTypes) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AllowedInputTypes"}
if v.AllowAudioInput == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowAudioInput"))
}
if v.AllowDTMFInput == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowDTMFInput"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssociatedTranscriptFilter(v *types.AssociatedTranscriptFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociatedTranscriptFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssociatedTranscriptFilters(v []types.AssociatedTranscriptFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociatedTranscriptFilters"}
for i := range v {
if err := validateAssociatedTranscriptFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioAndDTMFInputSpecification(v *types.AudioAndDTMFInputSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioAndDTMFInputSpecification"}
if v.StartTimeoutMs == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTimeoutMs"))
}
if v.AudioSpecification != nil {
if err := validateAudioSpecification(v.AudioSpecification); err != nil {
invalidParams.AddNested("AudioSpecification", err.(smithy.InvalidParamsError))
}
}
if v.DtmfSpecification != nil {
if err := validateDTMFSpecification(v.DtmfSpecification); err != nil {
invalidParams.AddNested("DtmfSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioLogDestination(v *types.AudioLogDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioLogDestination"}
if v.S3Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Bucket"))
} else if v.S3Bucket != nil {
if err := validateS3BucketLogDestination(v.S3Bucket); err != nil {
invalidParams.AddNested("S3Bucket", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioLogSetting(v *types.AudioLogSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioLogSetting"}
if v.Destination == nil {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
} else if v.Destination != nil {
if err := validateAudioLogDestination(v.Destination); err != nil {
invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioLogSettingsList(v []types.AudioLogSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioLogSettingsList"}
for i := range v {
if err := validateAudioLogSetting(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioSpecification(v *types.AudioSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioSpecification"}
if v.MaxLengthMs == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxLengthMs"))
}
if v.EndTimeoutMs == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTimeoutMs"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotAliasLocaleSettings(v *types.BotAliasLocaleSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotAliasLocaleSettings"}
if v.CodeHookSpecification != nil {
if err := validateCodeHookSpecification(v.CodeHookSpecification); err != nil {
invalidParams.AddNested("CodeHookSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotAliasLocaleSettingsMap(v map[string]types.BotAliasLocaleSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotAliasLocaleSettingsMap"}
for key := range v {
value := v[key]
if err := validateBotAliasLocaleSettings(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotAliasTestExecutionTarget(v *types.BotAliasTestExecutionTarget) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotAliasTestExecutionTarget"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotExportSpecification(v *types.BotExportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotExportSpecification"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotFilter(v *types.BotFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotFilters(v []types.BotFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotFilters"}
for i := range v {
if err := validateBotFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotImportSpecification(v *types.BotImportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotImportSpecification"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.DataPrivacy == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataPrivacy"))
} else if v.DataPrivacy != nil {
if err := validateDataPrivacy(v.DataPrivacy); err != nil {
invalidParams.AddNested("DataPrivacy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotLocaleExportSpecification(v *types.BotLocaleExportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotLocaleExportSpecification"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotLocaleFilter(v *types.BotLocaleFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotLocaleFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotLocaleFilters(v []types.BotLocaleFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotLocaleFilters"}
for i := range v {
if err := validateBotLocaleFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotLocaleImportSpecification(v *types.BotLocaleImportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotLocaleImportSpecification"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.VoiceSettings != nil {
if err := validateVoiceSettings(v.VoiceSettings); err != nil {
invalidParams.AddNested("VoiceSettings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotLocaleSortBy(v *types.BotLocaleSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotLocaleSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotMember(v *types.BotMember) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotMember"}
if v.BotMemberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotMemberId"))
}
if v.BotMemberName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotMemberName"))
}
if v.BotMemberAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotMemberAliasId"))
}
if v.BotMemberAliasName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotMemberAliasName"))
}
if v.BotMemberVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotMemberVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotMembers(v []types.BotMember) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotMembers"}
for i := range v {
if err := validateBotMember(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotSortBy(v *types.BotSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotVersionLocaleDetails(v *types.BotVersionLocaleDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotVersionLocaleDetails"}
if v.SourceBotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceBotVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotVersionLocaleSpecification(v map[string]types.BotVersionLocaleDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotVersionLocaleSpecification"}
for key := range v {
value := v[key]
if err := validateBotVersionLocaleDetails(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBotVersionSortBy(v *types.BotVersionSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BotVersionSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBuiltInIntentSortBy(v *types.BuiltInIntentSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BuiltInIntentSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBuiltInSlotTypeSortBy(v *types.BuiltInSlotTypeSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BuiltInSlotTypeSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateButton(v *types.Button) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Button"}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateButtonsList(v []types.Button) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ButtonsList"}
for i := range v {
if err := validateButton(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchLogGroupLogDestination(v *types.CloudWatchLogGroupLogDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLogGroupLogDestination"}
if v.CloudWatchLogGroupArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatchLogGroupArn"))
}
if v.LogPrefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogPrefix"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCodeHookSpecification(v *types.CodeHookSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CodeHookSpecification"}
if v.LambdaCodeHook == nil {
invalidParams.Add(smithy.NewErrParamRequired("LambdaCodeHook"))
} else if v.LambdaCodeHook != nil {
if err := validateLambdaCodeHook(v.LambdaCodeHook); err != nil {
invalidParams.AddNested("LambdaCodeHook", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCompositeSlotTypeSetting(v *types.CompositeSlotTypeSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CompositeSlotTypeSetting"}
if v.SubSlots != nil {
if err := validateSubSlotTypeList(v.SubSlots); err != nil {
invalidParams.AddNested("SubSlots", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCondition(v *types.Condition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Condition"}
if v.ExpressionString == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExpressionString"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConditionalBranch(v *types.ConditionalBranch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConditionalBranch"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Condition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Condition"))
} else if v.Condition != nil {
if err := validateCondition(v.Condition); err != nil {
invalidParams.AddNested("Condition", err.(smithy.InvalidParamsError))
}
}
if v.NextStep == nil {
invalidParams.Add(smithy.NewErrParamRequired("NextStep"))
} else if v.NextStep != nil {
if err := validateDialogState(v.NextStep); err != nil {
invalidParams.AddNested("NextStep", err.(smithy.InvalidParamsError))
}
}
if v.Response != nil {
if err := validateResponseSpecification(v.Response); err != nil {
invalidParams.AddNested("Response", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConditionalBranches(v []types.ConditionalBranch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConditionalBranches"}
for i := range v {
if err := validateConditionalBranch(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConditionalSpecification(v *types.ConditionalSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConditionalSpecification"}
if v.Active == nil {
invalidParams.Add(smithy.NewErrParamRequired("Active"))
}
if v.ConditionalBranches == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConditionalBranches"))
} else if v.ConditionalBranches != nil {
if err := validateConditionalBranches(v.ConditionalBranches); err != nil {
invalidParams.AddNested("ConditionalBranches", err.(smithy.InvalidParamsError))
}
}
if v.DefaultBranch == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultBranch"))
} else if v.DefaultBranch != nil {
if err := validateDefaultConditionalBranch(v.DefaultBranch); err != nil {
invalidParams.AddNested("DefaultBranch", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConversationLogsDataSource(v *types.ConversationLogsDataSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConversationLogsDataSource"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.Filter == nil {
invalidParams.Add(smithy.NewErrParamRequired("Filter"))
} else if v.Filter != nil {
if err := validateConversationLogsDataSourceFilterBy(v.Filter); err != nil {
invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConversationLogsDataSourceFilterBy(v *types.ConversationLogsDataSourceFilterBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConversationLogsDataSourceFilterBy"}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if len(v.InputMode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("InputMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConversationLogSettings(v *types.ConversationLogSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConversationLogSettings"}
if v.TextLogSettings != nil {
if err := validateTextLogSettingsList(v.TextLogSettings); err != nil {
invalidParams.AddNested("TextLogSettings", err.(smithy.InvalidParamsError))
}
}
if v.AudioLogSettings != nil {
if err := validateAudioLogSettingsList(v.AudioLogSettings); err != nil {
invalidParams.AddNested("AudioLogSettings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateCustomVocabularyItemsList(v []types.NewCustomVocabularyItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCustomVocabularyItemsList"}
for i := range v {
if err := validateNewCustomVocabularyItem(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomPayload(v *types.CustomPayload) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomPayload"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomVocabularyEntryId(v *types.CustomVocabularyEntryId) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomVocabularyEntryId"}
if v.ItemId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ItemId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomVocabularyExportSpecification(v *types.CustomVocabularyExportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomVocabularyExportSpecification"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomVocabularyImportSpecification(v *types.CustomVocabularyImportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomVocabularyImportSpecification"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomVocabularyItem(v *types.CustomVocabularyItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomVocabularyItem"}
if v.ItemId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ItemId"))
}
if v.Phrase == nil {
invalidParams.Add(smithy.NewErrParamRequired("Phrase"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDataPrivacy(v *types.DataPrivacy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataPrivacy"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDateRangeFilter(v *types.DateRangeFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DateRangeFilter"}
if v.StartDateTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDateTime"))
}
if v.EndDateTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDateTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDefaultConditionalBranch(v *types.DefaultConditionalBranch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DefaultConditionalBranch"}
if v.NextStep != nil {
if err := validateDialogState(v.NextStep); err != nil {
invalidParams.AddNested("NextStep", err.(smithy.InvalidParamsError))
}
}
if v.Response != nil {
if err := validateResponseSpecification(v.Response); err != nil {
invalidParams.AddNested("Response", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDeleteCustomVocabularyItemsList(v []types.CustomVocabularyEntryId) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomVocabularyItemsList"}
for i := range v {
if err := validateCustomVocabularyEntryId(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogAction(v *types.DialogAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogAction"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogCodeHookInvocationSetting(v *types.DialogCodeHookInvocationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogCodeHookInvocationSetting"}
if v.EnableCodeHookInvocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("EnableCodeHookInvocation"))
}
if v.Active == nil {
invalidParams.Add(smithy.NewErrParamRequired("Active"))
}
if v.PostCodeHookSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("PostCodeHookSpecification"))
} else if v.PostCodeHookSpecification != nil {
if err := validatePostDialogCodeHookInvocationSpecification(v.PostCodeHookSpecification); err != nil {
invalidParams.AddNested("PostCodeHookSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogCodeHookSettings(v *types.DialogCodeHookSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogCodeHookSettings"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogState(v *types.DialogState) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogState"}
if v.DialogAction != nil {
if err := validateDialogAction(v.DialogAction); err != nil {
invalidParams.AddNested("DialogAction", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDTMFSpecification(v *types.DTMFSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DTMFSpecification"}
if v.MaxLength == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxLength"))
}
if v.EndTimeoutMs == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTimeoutMs"))
}
if v.DeletionCharacter == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeletionCharacter"))
}
if v.EndCharacter == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndCharacter"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateElicitationCodeHookInvocationSetting(v *types.ElicitationCodeHookInvocationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ElicitationCodeHookInvocationSetting"}
if v.EnableCodeHookInvocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("EnableCodeHookInvocation"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExportFilter(v *types.ExportFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExportFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExportFilters(v []types.ExportFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExportFilters"}
for i := range v {
if err := validateExportFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExportResourceSpecification(v *types.ExportResourceSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExportResourceSpecification"}
if v.BotExportSpecification != nil {
if err := validateBotExportSpecification(v.BotExportSpecification); err != nil {
invalidParams.AddNested("BotExportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.BotLocaleExportSpecification != nil {
if err := validateBotLocaleExportSpecification(v.BotLocaleExportSpecification); err != nil {
invalidParams.AddNested("BotLocaleExportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.CustomVocabularyExportSpecification != nil {
if err := validateCustomVocabularyExportSpecification(v.CustomVocabularyExportSpecification); err != nil {
invalidParams.AddNested("CustomVocabularyExportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.TestSetExportSpecification != nil {
if err := validateTestSetExportSpecification(v.TestSetExportSpecification); err != nil {
invalidParams.AddNested("TestSetExportSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExportSortBy(v *types.ExportSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExportSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExternalSourceSetting(v *types.ExternalSourceSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExternalSourceSetting"}
if v.GrammarSlotTypeSetting != nil {
if err := validateGrammarSlotTypeSetting(v.GrammarSlotTypeSetting); err != nil {
invalidParams.AddNested("GrammarSlotTypeSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFulfillmentCodeHookSettings(v *types.FulfillmentCodeHookSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FulfillmentCodeHookSettings"}
if v.PostFulfillmentStatusSpecification != nil {
if err := validatePostFulfillmentStatusSpecification(v.PostFulfillmentStatusSpecification); err != nil {
invalidParams.AddNested("PostFulfillmentStatusSpecification", err.(smithy.InvalidParamsError))
}
}
if v.FulfillmentUpdatesSpecification != nil {
if err := validateFulfillmentUpdatesSpecification(v.FulfillmentUpdatesSpecification); err != nil {
invalidParams.AddNested("FulfillmentUpdatesSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFulfillmentStartResponseSpecification(v *types.FulfillmentStartResponseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FulfillmentStartResponseSpecification"}
if v.DelayInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DelayInSeconds"))
}
if v.MessageGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageGroups"))
} else if v.MessageGroups != nil {
if err := validateMessageGroupsList(v.MessageGroups); err != nil {
invalidParams.AddNested("MessageGroups", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFulfillmentUpdateResponseSpecification(v *types.FulfillmentUpdateResponseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FulfillmentUpdateResponseSpecification"}
if v.FrequencyInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("FrequencyInSeconds"))
}
if v.MessageGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageGroups"))
} else if v.MessageGroups != nil {
if err := validateMessageGroupsList(v.MessageGroups); err != nil {
invalidParams.AddNested("MessageGroups", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFulfillmentUpdatesSpecification(v *types.FulfillmentUpdatesSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FulfillmentUpdatesSpecification"}
if v.Active == nil {
invalidParams.Add(smithy.NewErrParamRequired("Active"))
}
if v.StartResponse != nil {
if err := validateFulfillmentStartResponseSpecification(v.StartResponse); err != nil {
invalidParams.AddNested("StartResponse", err.(smithy.InvalidParamsError))
}
}
if v.UpdateResponse != nil {
if err := validateFulfillmentUpdateResponseSpecification(v.UpdateResponse); err != nil {
invalidParams.AddNested("UpdateResponse", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGrammarSlotTypeSetting(v *types.GrammarSlotTypeSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GrammarSlotTypeSetting"}
if v.Source != nil {
if err := validateGrammarSlotTypeSource(v.Source); err != nil {
invalidParams.AddNested("Source", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGrammarSlotTypeSource(v *types.GrammarSlotTypeSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GrammarSlotTypeSource"}
if v.S3BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketName"))
}
if v.S3ObjectKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3ObjectKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImageResponseCard(v *types.ImageResponseCard) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImageResponseCard"}
if v.Title == nil {
invalidParams.Add(smithy.NewErrParamRequired("Title"))
}
if v.Buttons != nil {
if err := validateButtonsList(v.Buttons); err != nil {
invalidParams.AddNested("Buttons", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportFilter(v *types.ImportFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportFilters(v []types.ImportFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportFilters"}
for i := range v {
if err := validateImportFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportResourceSpecification(v *types.ImportResourceSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportResourceSpecification"}
if v.BotImportSpecification != nil {
if err := validateBotImportSpecification(v.BotImportSpecification); err != nil {
invalidParams.AddNested("BotImportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.BotLocaleImportSpecification != nil {
if err := validateBotLocaleImportSpecification(v.BotLocaleImportSpecification); err != nil {
invalidParams.AddNested("BotLocaleImportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.CustomVocabularyImportSpecification != nil {
if err := validateCustomVocabularyImportSpecification(v.CustomVocabularyImportSpecification); err != nil {
invalidParams.AddNested("CustomVocabularyImportSpecification", err.(smithy.InvalidParamsError))
}
}
if v.TestSetImportResourceSpecification != nil {
if err := validateTestSetImportResourceSpecification(v.TestSetImportResourceSpecification); err != nil {
invalidParams.AddNested("TestSetImportResourceSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportSortBy(v *types.ImportSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInitialResponseSetting(v *types.InitialResponseSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InitialResponseSetting"}
if v.InitialResponse != nil {
if err := validateResponseSpecification(v.InitialResponse); err != nil {
invalidParams.AddNested("InitialResponse", err.(smithy.InvalidParamsError))
}
}
if v.NextStep != nil {
if err := validateDialogState(v.NextStep); err != nil {
invalidParams.AddNested("NextStep", err.(smithy.InvalidParamsError))
}
}
if v.Conditional != nil {
if err := validateConditionalSpecification(v.Conditional); err != nil {
invalidParams.AddNested("Conditional", err.(smithy.InvalidParamsError))
}
}
if v.CodeHook != nil {
if err := validateDialogCodeHookInvocationSetting(v.CodeHook); err != nil {
invalidParams.AddNested("CodeHook", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputContext(v *types.InputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputContextsList(v []types.InputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputContextsList"}
for i := range v {
if err := validateInputContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentClosingSetting(v *types.IntentClosingSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentClosingSetting"}
if v.ClosingResponse != nil {
if err := validateResponseSpecification(v.ClosingResponse); err != nil {
invalidParams.AddNested("ClosingResponse", err.(smithy.InvalidParamsError))
}
}
if v.NextStep != nil {
if err := validateDialogState(v.NextStep); err != nil {
invalidParams.AddNested("NextStep", err.(smithy.InvalidParamsError))
}
}
if v.Conditional != nil {
if err := validateConditionalSpecification(v.Conditional); err != nil {
invalidParams.AddNested("Conditional", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentConfirmationSetting(v *types.IntentConfirmationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentConfirmationSetting"}
if v.PromptSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("PromptSpecification"))
} else if v.PromptSpecification != nil {
if err := validatePromptSpecification(v.PromptSpecification); err != nil {
invalidParams.AddNested("PromptSpecification", err.(smithy.InvalidParamsError))
}
}
if v.DeclinationResponse != nil {
if err := validateResponseSpecification(v.DeclinationResponse); err != nil {
invalidParams.AddNested("DeclinationResponse", err.(smithy.InvalidParamsError))
}
}
if v.ConfirmationResponse != nil {
if err := validateResponseSpecification(v.ConfirmationResponse); err != nil {
invalidParams.AddNested("ConfirmationResponse", err.(smithy.InvalidParamsError))
}
}
if v.ConfirmationNextStep != nil {
if err := validateDialogState(v.ConfirmationNextStep); err != nil {
invalidParams.AddNested("ConfirmationNextStep", err.(smithy.InvalidParamsError))
}
}
if v.ConfirmationConditional != nil {
if err := validateConditionalSpecification(v.ConfirmationConditional); err != nil {
invalidParams.AddNested("ConfirmationConditional", err.(smithy.InvalidParamsError))
}
}
if v.DeclinationNextStep != nil {
if err := validateDialogState(v.DeclinationNextStep); err != nil {
invalidParams.AddNested("DeclinationNextStep", err.(smithy.InvalidParamsError))
}
}
if v.DeclinationConditional != nil {
if err := validateConditionalSpecification(v.DeclinationConditional); err != nil {
invalidParams.AddNested("DeclinationConditional", err.(smithy.InvalidParamsError))
}
}
if v.FailureResponse != nil {
if err := validateResponseSpecification(v.FailureResponse); err != nil {
invalidParams.AddNested("FailureResponse", err.(smithy.InvalidParamsError))
}
}
if v.FailureNextStep != nil {
if err := validateDialogState(v.FailureNextStep); err != nil {
invalidParams.AddNested("FailureNextStep", err.(smithy.InvalidParamsError))
}
}
if v.FailureConditional != nil {
if err := validateConditionalSpecification(v.FailureConditional); err != nil {
invalidParams.AddNested("FailureConditional", err.(smithy.InvalidParamsError))
}
}
if v.CodeHook != nil {
if err := validateDialogCodeHookInvocationSetting(v.CodeHook); err != nil {
invalidParams.AddNested("CodeHook", err.(smithy.InvalidParamsError))
}
}
if v.ElicitationCodeHook != nil {
if err := validateElicitationCodeHookInvocationSetting(v.ElicitationCodeHook); err != nil {
invalidParams.AddNested("ElicitationCodeHook", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentFilter(v *types.IntentFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentFilters(v []types.IntentFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentFilters"}
for i := range v {
if err := validateIntentFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentSortBy(v *types.IntentSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKendraConfiguration(v *types.KendraConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KendraConfiguration"}
if v.KendraIndex == nil {
invalidParams.Add(smithy.NewErrParamRequired("KendraIndex"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLambdaCodeHook(v *types.LambdaCodeHook) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LambdaCodeHook"}
if v.LambdaARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("LambdaARN"))
}
if v.CodeHookInterfaceVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeHookInterfaceVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLexTranscriptFilter(v *types.LexTranscriptFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LexTranscriptFilter"}
if v.DateRangeFilter != nil {
if err := validateDateRangeFilter(v.DateRangeFilter); err != nil {
invalidParams.AddNested("DateRangeFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessage(v *types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Message"}
if v.PlainTextMessage != nil {
if err := validatePlainTextMessage(v.PlainTextMessage); err != nil {
invalidParams.AddNested("PlainTextMessage", err.(smithy.InvalidParamsError))
}
}
if v.CustomPayload != nil {
if err := validateCustomPayload(v.CustomPayload); err != nil {
invalidParams.AddNested("CustomPayload", err.(smithy.InvalidParamsError))
}
}
if v.SsmlMessage != nil {
if err := validateSSMLMessage(v.SsmlMessage); err != nil {
invalidParams.AddNested("SsmlMessage", err.(smithy.InvalidParamsError))
}
}
if v.ImageResponseCard != nil {
if err := validateImageResponseCard(v.ImageResponseCard); err != nil {
invalidParams.AddNested("ImageResponseCard", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageGroup(v *types.MessageGroup) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageGroup"}
if v.Message == nil {
invalidParams.Add(smithy.NewErrParamRequired("Message"))
} else if v.Message != nil {
if err := validateMessage(v.Message); err != nil {
invalidParams.AddNested("Message", err.(smithy.InvalidParamsError))
}
}
if v.Variations != nil {
if err := validateMessageVariationsList(v.Variations); err != nil {
invalidParams.AddNested("Variations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageGroupsList(v []types.MessageGroup) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageGroupsList"}
for i := range v {
if err := validateMessageGroup(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageVariationsList(v []types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageVariationsList"}
for i := range v {
if err := validateMessage(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateNewCustomVocabularyItem(v *types.NewCustomVocabularyItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "NewCustomVocabularyItem"}
if v.Phrase == nil {
invalidParams.Add(smithy.NewErrParamRequired("Phrase"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateObfuscationSetting(v *types.ObfuscationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ObfuscationSetting"}
if len(v.ObfuscationSettingType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ObfuscationSettingType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputContext(v *types.OutputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TimeToLiveInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeToLiveInSeconds"))
}
if v.TurnsToLive == nil {
invalidParams.Add(smithy.NewErrParamRequired("TurnsToLive"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputContextsList(v []types.OutputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputContextsList"}
for i := range v {
if err := validateOutputContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePlainTextMessage(v *types.PlainTextMessage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PlainTextMessage"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePostDialogCodeHookInvocationSpecification(v *types.PostDialogCodeHookInvocationSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PostDialogCodeHookInvocationSpecification"}
if v.SuccessResponse != nil {
if err := validateResponseSpecification(v.SuccessResponse); err != nil {
invalidParams.AddNested("SuccessResponse", err.(smithy.InvalidParamsError))
}
}
if v.SuccessNextStep != nil {
if err := validateDialogState(v.SuccessNextStep); err != nil {
invalidParams.AddNested("SuccessNextStep", err.(smithy.InvalidParamsError))
}
}
if v.SuccessConditional != nil {
if err := validateConditionalSpecification(v.SuccessConditional); err != nil {
invalidParams.AddNested("SuccessConditional", err.(smithy.InvalidParamsError))
}
}
if v.FailureResponse != nil {
if err := validateResponseSpecification(v.FailureResponse); err != nil {
invalidParams.AddNested("FailureResponse", err.(smithy.InvalidParamsError))
}
}
if v.FailureNextStep != nil {
if err := validateDialogState(v.FailureNextStep); err != nil {
invalidParams.AddNested("FailureNextStep", err.(smithy.InvalidParamsError))
}
}
if v.FailureConditional != nil {
if err := validateConditionalSpecification(v.FailureConditional); err != nil {
invalidParams.AddNested("FailureConditional", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutResponse != nil {
if err := validateResponseSpecification(v.TimeoutResponse); err != nil {
invalidParams.AddNested("TimeoutResponse", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutNextStep != nil {
if err := validateDialogState(v.TimeoutNextStep); err != nil {
invalidParams.AddNested("TimeoutNextStep", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutConditional != nil {
if err := validateConditionalSpecification(v.TimeoutConditional); err != nil {
invalidParams.AddNested("TimeoutConditional", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePostFulfillmentStatusSpecification(v *types.PostFulfillmentStatusSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PostFulfillmentStatusSpecification"}
if v.SuccessResponse != nil {
if err := validateResponseSpecification(v.SuccessResponse); err != nil {
invalidParams.AddNested("SuccessResponse", err.(smithy.InvalidParamsError))
}
}
if v.FailureResponse != nil {
if err := validateResponseSpecification(v.FailureResponse); err != nil {
invalidParams.AddNested("FailureResponse", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutResponse != nil {
if err := validateResponseSpecification(v.TimeoutResponse); err != nil {
invalidParams.AddNested("TimeoutResponse", err.(smithy.InvalidParamsError))
}
}
if v.SuccessNextStep != nil {
if err := validateDialogState(v.SuccessNextStep); err != nil {
invalidParams.AddNested("SuccessNextStep", err.(smithy.InvalidParamsError))
}
}
if v.SuccessConditional != nil {
if err := validateConditionalSpecification(v.SuccessConditional); err != nil {
invalidParams.AddNested("SuccessConditional", err.(smithy.InvalidParamsError))
}
}
if v.FailureNextStep != nil {
if err := validateDialogState(v.FailureNextStep); err != nil {
invalidParams.AddNested("FailureNextStep", err.(smithy.InvalidParamsError))
}
}
if v.FailureConditional != nil {
if err := validateConditionalSpecification(v.FailureConditional); err != nil {
invalidParams.AddNested("FailureConditional", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutNextStep != nil {
if err := validateDialogState(v.TimeoutNextStep); err != nil {
invalidParams.AddNested("TimeoutNextStep", err.(smithy.InvalidParamsError))
}
}
if v.TimeoutConditional != nil {
if err := validateConditionalSpecification(v.TimeoutConditional); err != nil {
invalidParams.AddNested("TimeoutConditional", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePromptAttemptSpecification(v *types.PromptAttemptSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PromptAttemptSpecification"}
if v.AllowedInputTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowedInputTypes"))
} else if v.AllowedInputTypes != nil {
if err := validateAllowedInputTypes(v.AllowedInputTypes); err != nil {
invalidParams.AddNested("AllowedInputTypes", err.(smithy.InvalidParamsError))
}
}
if v.AudioAndDTMFInputSpecification != nil {
if err := validateAudioAndDTMFInputSpecification(v.AudioAndDTMFInputSpecification); err != nil {
invalidParams.AddNested("AudioAndDTMFInputSpecification", err.(smithy.InvalidParamsError))
}
}
if v.TextInputSpecification != nil {
if err := validateTextInputSpecification(v.TextInputSpecification); err != nil {
invalidParams.AddNested("TextInputSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePromptAttemptsSpecificationMap(v map[string]types.PromptAttemptSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PromptAttemptsSpecificationMap"}
for key := range v {
value := v[key]
if err := validatePromptAttemptSpecification(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePromptSpecification(v *types.PromptSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PromptSpecification"}
if v.MessageGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageGroups"))
} else if v.MessageGroups != nil {
if err := validateMessageGroupsList(v.MessageGroups); err != nil {
invalidParams.AddNested("MessageGroups", err.(smithy.InvalidParamsError))
}
}
if v.MaxRetries == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxRetries"))
}
if v.PromptAttemptsSpecification != nil {
if err := validatePromptAttemptsSpecificationMap(v.PromptAttemptsSpecification); err != nil {
invalidParams.AddNested("PromptAttemptsSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRelativeAggregationDuration(v *types.RelativeAggregationDuration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RelativeAggregationDuration"}
if len(v.TimeDimension) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TimeDimension"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseSpecification(v *types.ResponseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseSpecification"}
if v.MessageGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageGroups"))
} else if v.MessageGroups != nil {
if err := validateMessageGroupsList(v.MessageGroups); err != nil {
invalidParams.AddNested("MessageGroups", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3BucketLogDestination(v *types.S3BucketLogDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3BucketLogDestination"}
if v.S3BucketArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketArn"))
}
if v.LogPrefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogPrefix"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3BucketTranscriptSource(v *types.S3BucketTranscriptSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3BucketTranscriptSource"}
if v.S3BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketName"))
}
if len(v.TranscriptFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptFormat"))
}
if v.TranscriptFilter != nil {
if err := validateTranscriptFilter(v.TranscriptFilter); err != nil {
invalidParams.AddNested("TranscriptFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSampleUtterance(v *types.SampleUtterance) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SampleUtterance"}
if v.Utterance == nil {
invalidParams.Add(smithy.NewErrParamRequired("Utterance"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSampleUtterancesList(v []types.SampleUtterance) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SampleUtterancesList"}
for i := range v {
if err := validateSampleUtterance(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSampleValue(v *types.SampleValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SampleValue"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSentimentAnalysisSettings(v *types.SentimentAnalysisSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SentimentAnalysisSettings"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotCaptureSetting(v *types.SlotCaptureSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotCaptureSetting"}
if v.CaptureResponse != nil {
if err := validateResponseSpecification(v.CaptureResponse); err != nil {
invalidParams.AddNested("CaptureResponse", err.(smithy.InvalidParamsError))
}
}
if v.CaptureNextStep != nil {
if err := validateDialogState(v.CaptureNextStep); err != nil {
invalidParams.AddNested("CaptureNextStep", err.(smithy.InvalidParamsError))
}
}
if v.CaptureConditional != nil {
if err := validateConditionalSpecification(v.CaptureConditional); err != nil {
invalidParams.AddNested("CaptureConditional", err.(smithy.InvalidParamsError))
}
}
if v.FailureResponse != nil {
if err := validateResponseSpecification(v.FailureResponse); err != nil {
invalidParams.AddNested("FailureResponse", err.(smithy.InvalidParamsError))
}
}
if v.FailureNextStep != nil {
if err := validateDialogState(v.FailureNextStep); err != nil {
invalidParams.AddNested("FailureNextStep", err.(smithy.InvalidParamsError))
}
}
if v.FailureConditional != nil {
if err := validateConditionalSpecification(v.FailureConditional); err != nil {
invalidParams.AddNested("FailureConditional", err.(smithy.InvalidParamsError))
}
}
if v.CodeHook != nil {
if err := validateDialogCodeHookInvocationSetting(v.CodeHook); err != nil {
invalidParams.AddNested("CodeHook", err.(smithy.InvalidParamsError))
}
}
if v.ElicitationCodeHook != nil {
if err := validateElicitationCodeHookInvocationSetting(v.ElicitationCodeHook); err != nil {
invalidParams.AddNested("ElicitationCodeHook", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValue(v *types.SlotDefaultValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValue"}
if v.DefaultValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValueList(v []types.SlotDefaultValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValueList"}
for i := range v {
if err := validateSlotDefaultValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValueSpecification(v *types.SlotDefaultValueSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValueSpecification"}
if v.DefaultValueList == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultValueList"))
} else if v.DefaultValueList != nil {
if err := validateSlotDefaultValueList(v.DefaultValueList); err != nil {
invalidParams.AddNested("DefaultValueList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotFilter(v *types.SlotFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotFilters(v []types.SlotFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotFilters"}
for i := range v {
if err := validateSlotFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotPrioritiesList(v []types.SlotPriority) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotPrioritiesList"}
for i := range v {
if err := validateSlotPriority(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotPriority(v *types.SlotPriority) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotPriority"}
if v.Priority == nil {
invalidParams.Add(smithy.NewErrParamRequired("Priority"))
}
if v.SlotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotSortBy(v *types.SlotSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeFilter(v *types.SlotTypeFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if len(v.Operator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Operator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeFilters(v []types.SlotTypeFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeFilters"}
for i := range v {
if err := validateSlotTypeFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeSortBy(v *types.SlotTypeSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeValue(v *types.SlotTypeValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeValue"}
if v.SampleValue != nil {
if err := validateSampleValue(v.SampleValue); err != nil {
invalidParams.AddNested("SampleValue", err.(smithy.InvalidParamsError))
}
}
if v.Synonyms != nil {
if err := validateSynonymList(v.Synonyms); err != nil {
invalidParams.AddNested("Synonyms", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeValues(v []types.SlotTypeValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeValues"}
for i := range v {
if err := validateSlotTypeValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotValueElicitationSetting(v *types.SlotValueElicitationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotValueElicitationSetting"}
if v.DefaultValueSpecification != nil {
if err := validateSlotDefaultValueSpecification(v.DefaultValueSpecification); err != nil {
invalidParams.AddNested("DefaultValueSpecification", err.(smithy.InvalidParamsError))
}
}
if len(v.SlotConstraint) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SlotConstraint"))
}
if v.PromptSpecification != nil {
if err := validatePromptSpecification(v.PromptSpecification); err != nil {
invalidParams.AddNested("PromptSpecification", err.(smithy.InvalidParamsError))
}
}
if v.SampleUtterances != nil {
if err := validateSampleUtterancesList(v.SampleUtterances); err != nil {
invalidParams.AddNested("SampleUtterances", err.(smithy.InvalidParamsError))
}
}
if v.WaitAndContinueSpecification != nil {
if err := validateWaitAndContinueSpecification(v.WaitAndContinueSpecification); err != nil {
invalidParams.AddNested("WaitAndContinueSpecification", err.(smithy.InvalidParamsError))
}
}
if v.SlotCaptureSetting != nil {
if err := validateSlotCaptureSetting(v.SlotCaptureSetting); err != nil {
invalidParams.AddNested("SlotCaptureSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotValueRegexFilter(v *types.SlotValueRegexFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotValueRegexFilter"}
if v.Pattern == nil {
invalidParams.Add(smithy.NewErrParamRequired("Pattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotValueSelectionSetting(v *types.SlotValueSelectionSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotValueSelectionSetting"}
if len(v.ResolutionStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ResolutionStrategy"))
}
if v.RegexFilter != nil {
if err := validateSlotValueRegexFilter(v.RegexFilter); err != nil {
invalidParams.AddNested("RegexFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSpecifications(v *types.Specifications) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Specifications"}
if v.SlotTypeId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeId"))
}
if v.ValueElicitationSetting == nil {
invalidParams.Add(smithy.NewErrParamRequired("ValueElicitationSetting"))
} else if v.ValueElicitationSetting != nil {
if err := validateSubSlotValueElicitationSetting(v.ValueElicitationSetting); err != nil {
invalidParams.AddNested("ValueElicitationSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSSMLMessage(v *types.SSMLMessage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SSMLMessage"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStillWaitingResponseSpecification(v *types.StillWaitingResponseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StillWaitingResponseSpecification"}
if v.MessageGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageGroups"))
} else if v.MessageGroups != nil {
if err := validateMessageGroupsList(v.MessageGroups); err != nil {
invalidParams.AddNested("MessageGroups", err.(smithy.InvalidParamsError))
}
}
if v.FrequencyInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("FrequencyInSeconds"))
}
if v.TimeoutInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeoutInSeconds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSubSlotSetting(v *types.SubSlotSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubSlotSetting"}
if v.SlotSpecifications != nil {
if err := validateSubSlotSpecificationMap(v.SlotSpecifications); err != nil {
invalidParams.AddNested("SlotSpecifications", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSubSlotSpecificationMap(v map[string]types.Specifications) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubSlotSpecificationMap"}
for key := range v {
value := v[key]
if err := validateSpecifications(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSubSlotTypeComposition(v *types.SubSlotTypeComposition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubSlotTypeComposition"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SlotTypeId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSubSlotTypeList(v []types.SubSlotTypeComposition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubSlotTypeList"}
for i := range v {
if err := validateSubSlotTypeComposition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSubSlotValueElicitationSetting(v *types.SubSlotValueElicitationSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubSlotValueElicitationSetting"}
if v.DefaultValueSpecification != nil {
if err := validateSlotDefaultValueSpecification(v.DefaultValueSpecification); err != nil {
invalidParams.AddNested("DefaultValueSpecification", err.(smithy.InvalidParamsError))
}
}
if v.PromptSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("PromptSpecification"))
} else if v.PromptSpecification != nil {
if err := validatePromptSpecification(v.PromptSpecification); err != nil {
invalidParams.AddNested("PromptSpecification", err.(smithy.InvalidParamsError))
}
}
if v.SampleUtterances != nil {
if err := validateSampleUtterancesList(v.SampleUtterances); err != nil {
invalidParams.AddNested("SampleUtterances", err.(smithy.InvalidParamsError))
}
}
if v.WaitAndContinueSpecification != nil {
if err := validateWaitAndContinueSpecification(v.WaitAndContinueSpecification); err != nil {
invalidParams.AddNested("WaitAndContinueSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSynonymList(v []types.SampleValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SynonymList"}
for i := range v {
if err := validateSampleValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestExecutionResultFilterBy(v *types.TestExecutionResultFilterBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestExecutionResultFilterBy"}
if len(v.ResultTypeFilter) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ResultTypeFilter"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestExecutionSortBy(v *types.TestExecutionSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestExecutionSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestExecutionTarget(v *types.TestExecutionTarget) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestExecutionTarget"}
if v.BotAliasTarget != nil {
if err := validateBotAliasTestExecutionTarget(v.BotAliasTarget); err != nil {
invalidParams.AddNested("BotAliasTarget", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetDiscrepancyReportBotAliasTarget(v *types.TestSetDiscrepancyReportBotAliasTarget) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetDiscrepancyReportBotAliasTarget"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetDiscrepancyReportResourceTarget(v *types.TestSetDiscrepancyReportResourceTarget) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetDiscrepancyReportResourceTarget"}
if v.BotAliasTarget != nil {
if err := validateTestSetDiscrepancyReportBotAliasTarget(v.BotAliasTarget); err != nil {
invalidParams.AddNested("BotAliasTarget", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetExportSpecification(v *types.TestSetExportSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetExportSpecification"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetGenerationDataSource(v *types.TestSetGenerationDataSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetGenerationDataSource"}
if v.ConversationLogsDataSource != nil {
if err := validateConversationLogsDataSource(v.ConversationLogsDataSource); err != nil {
invalidParams.AddNested("ConversationLogsDataSource", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetImportInputLocation(v *types.TestSetImportInputLocation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetImportInputLocation"}
if v.S3BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketName"))
}
if v.S3Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetImportResourceSpecification(v *types.TestSetImportResourceSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetImportResourceSpecification"}
if v.TestSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetName"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.StorageLocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("StorageLocation"))
} else if v.StorageLocation != nil {
if err := validateTestSetStorageLocation(v.StorageLocation); err != nil {
invalidParams.AddNested("StorageLocation", err.(smithy.InvalidParamsError))
}
}
if v.ImportInputLocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportInputLocation"))
} else if v.ImportInputLocation != nil {
if err := validateTestSetImportInputLocation(v.ImportInputLocation); err != nil {
invalidParams.AddNested("ImportInputLocation", err.(smithy.InvalidParamsError))
}
}
if len(v.Modality) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Modality"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetSortBy(v *types.TestSetSortBy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetSortBy"}
if len(v.Attribute) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Attribute"))
}
if len(v.Order) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Order"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTestSetStorageLocation(v *types.TestSetStorageLocation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestSetStorageLocation"}
if v.S3BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketName"))
}
if v.S3Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextInputSpecification(v *types.TextInputSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextInputSpecification"}
if v.StartTimeoutMs == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTimeoutMs"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextLogDestination(v *types.TextLogDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextLogDestination"}
if v.CloudWatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatch"))
} else if v.CloudWatch != nil {
if err := validateCloudWatchLogGroupLogDestination(v.CloudWatch); err != nil {
invalidParams.AddNested("CloudWatch", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextLogSetting(v *types.TextLogSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextLogSetting"}
if v.Destination == nil {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
} else if v.Destination != nil {
if err := validateTextLogDestination(v.Destination); err != nil {
invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextLogSettingsList(v []types.TextLogSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextLogSettingsList"}
for i := range v {
if err := validateTextLogSetting(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTranscriptFilter(v *types.TranscriptFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TranscriptFilter"}
if v.LexTranscriptFilter != nil {
if err := validateLexTranscriptFilter(v.LexTranscriptFilter); err != nil {
invalidParams.AddNested("LexTranscriptFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTranscriptSourceSetting(v *types.TranscriptSourceSetting) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TranscriptSourceSetting"}
if v.S3BucketTranscriptSource != nil {
if err := validateS3BucketTranscriptSource(v.S3BucketTranscriptSource); err != nil {
invalidParams.AddNested("S3BucketTranscriptSource", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateCustomVocabularyItemsList(v []types.CustomVocabularyItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateCustomVocabularyItemsList"}
for i := range v {
if err := validateCustomVocabularyItem(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUtteranceAggregationDuration(v *types.UtteranceAggregationDuration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UtteranceAggregationDuration"}
if v.RelativeAggregationDuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelativeAggregationDuration"))
} else if v.RelativeAggregationDuration != nil {
if err := validateRelativeAggregationDuration(v.RelativeAggregationDuration); err != nil {
invalidParams.AddNested("RelativeAggregationDuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVoiceSettings(v *types.VoiceSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VoiceSettings"}
if v.VoiceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VoiceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateWaitAndContinueSpecification(v *types.WaitAndContinueSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "WaitAndContinueSpecification"}
if v.WaitingResponse == nil {
invalidParams.Add(smithy.NewErrParamRequired("WaitingResponse"))
} else if v.WaitingResponse != nil {
if err := validateResponseSpecification(v.WaitingResponse); err != nil {
invalidParams.AddNested("WaitingResponse", err.(smithy.InvalidParamsError))
}
}
if v.ContinueResponse == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContinueResponse"))
} else if v.ContinueResponse != nil {
if err := validateResponseSpecification(v.ContinueResponse); err != nil {
invalidParams.AddNested("ContinueResponse", err.(smithy.InvalidParamsError))
}
}
if v.StillWaitingResponse != nil {
if err := validateStillWaitingResponseSpecification(v.StillWaitingResponse); err != nil {
invalidParams.AddNested("StillWaitingResponse", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchCreateCustomVocabularyItemInput(v *BatchCreateCustomVocabularyItemInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchCreateCustomVocabularyItemInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.CustomVocabularyItemList == nil {
invalidParams.Add(smithy.NewErrParamRequired("CustomVocabularyItemList"))
} else if v.CustomVocabularyItemList != nil {
if err := validateCreateCustomVocabularyItemsList(v.CustomVocabularyItemList); err != nil {
invalidParams.AddNested("CustomVocabularyItemList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchDeleteCustomVocabularyItemInput(v *BatchDeleteCustomVocabularyItemInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteCustomVocabularyItemInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.CustomVocabularyItemList == nil {
invalidParams.Add(smithy.NewErrParamRequired("CustomVocabularyItemList"))
} else if v.CustomVocabularyItemList != nil {
if err := validateDeleteCustomVocabularyItemsList(v.CustomVocabularyItemList); err != nil {
invalidParams.AddNested("CustomVocabularyItemList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchUpdateCustomVocabularyItemInput(v *BatchUpdateCustomVocabularyItemInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchUpdateCustomVocabularyItemInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.CustomVocabularyItemList == nil {
invalidParams.Add(smithy.NewErrParamRequired("CustomVocabularyItemList"))
} else if v.CustomVocabularyItemList != nil {
if err := validateUpdateCustomVocabularyItemsList(v.CustomVocabularyItemList); err != nil {
invalidParams.AddNested("CustomVocabularyItemList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBuildBotLocaleInput(v *BuildBotLocaleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BuildBotLocaleInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBotAliasInput(v *CreateBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBotAliasInput"}
if v.BotAliasName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasName"))
}
if v.BotAliasLocaleSettings != nil {
if err := validateBotAliasLocaleSettingsMap(v.BotAliasLocaleSettings); err != nil {
invalidParams.AddNested("BotAliasLocaleSettings", err.(smithy.InvalidParamsError))
}
}
if v.ConversationLogSettings != nil {
if err := validateConversationLogSettings(v.ConversationLogSettings); err != nil {
invalidParams.AddNested("ConversationLogSettings", err.(smithy.InvalidParamsError))
}
}
if v.SentimentAnalysisSettings != nil {
if err := validateSentimentAnalysisSettings(v.SentimentAnalysisSettings); err != nil {
invalidParams.AddNested("SentimentAnalysisSettings", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBotInput(v *CreateBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBotInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.DataPrivacy == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataPrivacy"))
} else if v.DataPrivacy != nil {
if err := validateDataPrivacy(v.DataPrivacy); err != nil {
invalidParams.AddNested("DataPrivacy", err.(smithy.InvalidParamsError))
}
}
if v.IdleSessionTTLInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("IdleSessionTTLInSeconds"))
}
if v.BotMembers != nil {
if err := validateBotMembers(v.BotMembers); err != nil {
invalidParams.AddNested("BotMembers", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBotLocaleInput(v *CreateBotLocaleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBotLocaleInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.NluIntentConfidenceThreshold == nil {
invalidParams.Add(smithy.NewErrParamRequired("NluIntentConfidenceThreshold"))
}
if v.VoiceSettings != nil {
if err := validateVoiceSettings(v.VoiceSettings); err != nil {
invalidParams.AddNested("VoiceSettings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBotVersionInput(v *CreateBotVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBotVersionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersionLocaleSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersionLocaleSpecification"))
} else if v.BotVersionLocaleSpecification != nil {
if err := validateBotVersionLocaleSpecification(v.BotVersionLocaleSpecification); err != nil {
invalidParams.AddNested("BotVersionLocaleSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateExportInput(v *CreateExportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExportInput"}
if v.ResourceSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceSpecification"))
} else if v.ResourceSpecification != nil {
if err := validateExportResourceSpecification(v.ResourceSpecification); err != nil {
invalidParams.AddNested("ResourceSpecification", err.(smithy.InvalidParamsError))
}
}
if len(v.FileFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("FileFormat"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateIntentInput(v *CreateIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateIntentInput"}
if v.IntentName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentName"))
}
if v.SampleUtterances != nil {
if err := validateSampleUtterancesList(v.SampleUtterances); err != nil {
invalidParams.AddNested("SampleUtterances", err.(smithy.InvalidParamsError))
}
}
if v.DialogCodeHook != nil {
if err := validateDialogCodeHookSettings(v.DialogCodeHook); err != nil {
invalidParams.AddNested("DialogCodeHook", err.(smithy.InvalidParamsError))
}
}
if v.FulfillmentCodeHook != nil {
if err := validateFulfillmentCodeHookSettings(v.FulfillmentCodeHook); err != nil {
invalidParams.AddNested("FulfillmentCodeHook", err.(smithy.InvalidParamsError))
}
}
if v.IntentConfirmationSetting != nil {
if err := validateIntentConfirmationSetting(v.IntentConfirmationSetting); err != nil {
invalidParams.AddNested("IntentConfirmationSetting", err.(smithy.InvalidParamsError))
}
}
if v.IntentClosingSetting != nil {
if err := validateIntentClosingSetting(v.IntentClosingSetting); err != nil {
invalidParams.AddNested("IntentClosingSetting", err.(smithy.InvalidParamsError))
}
}
if v.InputContexts != nil {
if err := validateInputContextsList(v.InputContexts); err != nil {
invalidParams.AddNested("InputContexts", err.(smithy.InvalidParamsError))
}
}
if v.OutputContexts != nil {
if err := validateOutputContextsList(v.OutputContexts); err != nil {
invalidParams.AddNested("OutputContexts", err.(smithy.InvalidParamsError))
}
}
if v.KendraConfiguration != nil {
if err := validateKendraConfiguration(v.KendraConfiguration); err != nil {
invalidParams.AddNested("KendraConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.InitialResponseSetting != nil {
if err := validateInitialResponseSetting(v.InitialResponseSetting); err != nil {
invalidParams.AddNested("InitialResponseSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateResourcePolicyInput(v *CreateResourcePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateResourcePolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateResourcePolicyStatementInput(v *CreateResourcePolicyStatementInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateResourcePolicyStatementInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if len(v.Effect) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Effect"))
}
if v.Principal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principal"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSlotInput(v *CreateSlotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSlotInput"}
if v.SlotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotName"))
}
if v.ValueElicitationSetting == nil {
invalidParams.Add(smithy.NewErrParamRequired("ValueElicitationSetting"))
} else if v.ValueElicitationSetting != nil {
if err := validateSlotValueElicitationSetting(v.ValueElicitationSetting); err != nil {
invalidParams.AddNested("ValueElicitationSetting", err.(smithy.InvalidParamsError))
}
}
if v.ObfuscationSetting != nil {
if err := validateObfuscationSetting(v.ObfuscationSetting); err != nil {
invalidParams.AddNested("ObfuscationSetting", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.SubSlotSetting != nil {
if err := validateSubSlotSetting(v.SubSlotSetting); err != nil {
invalidParams.AddNested("SubSlotSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSlotTypeInput(v *CreateSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSlotTypeInput"}
if v.SlotTypeName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeName"))
}
if v.SlotTypeValues != nil {
if err := validateSlotTypeValues(v.SlotTypeValues); err != nil {
invalidParams.AddNested("SlotTypeValues", err.(smithy.InvalidParamsError))
}
}
if v.ValueSelectionSetting != nil {
if err := validateSlotValueSelectionSetting(v.ValueSelectionSetting); err != nil {
invalidParams.AddNested("ValueSelectionSetting", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.ExternalSourceSetting != nil {
if err := validateExternalSourceSetting(v.ExternalSourceSetting); err != nil {
invalidParams.AddNested("ExternalSourceSetting", err.(smithy.InvalidParamsError))
}
}
if v.CompositeSlotTypeSetting != nil {
if err := validateCompositeSlotTypeSetting(v.CompositeSlotTypeSetting); err != nil {
invalidParams.AddNested("CompositeSlotTypeSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTestSetDiscrepancyReportInput(v *CreateTestSetDiscrepancyReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTestSetDiscrepancyReportInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if v.Target == nil {
invalidParams.Add(smithy.NewErrParamRequired("Target"))
} else if v.Target != nil {
if err := validateTestSetDiscrepancyReportResourceTarget(v.Target); err != nil {
invalidParams.AddNested("Target", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotAliasInput(v *DeleteBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotAliasInput"}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotInput(v *DeleteBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotLocaleInput(v *DeleteBotLocaleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotLocaleInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotVersionInput(v *DeleteBotVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotVersionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCustomVocabularyInput(v *DeleteCustomVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomVocabularyInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteExportInput(v *DeleteExportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteExportInput"}
if v.ExportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteImportInput(v *DeleteImportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteImportInput"}
if v.ImportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteIntentInput(v *DeleteIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteIntentInput"}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteResourcePolicyStatementInput(v *DeleteResourcePolicyStatementInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyStatementInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlotInput(v *DeleteSlotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlotInput"}
if v.SlotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlotTypeInput(v *DeleteSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlotTypeInput"}
if v.SlotTypeId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTestSetInput(v *DeleteTestSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTestSetInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteUtterancesInput(v *DeleteUtterancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteUtterancesInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBotAliasInput(v *DescribeBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBotAliasInput"}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBotInput(v *DescribeBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBotInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBotLocaleInput(v *DescribeBotLocaleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBotLocaleInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBotRecommendationInput(v *DescribeBotRecommendationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBotRecommendationInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.BotRecommendationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotRecommendationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBotVersionInput(v *DescribeBotVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBotVersionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCustomVocabularyMetadataInput(v *DescribeCustomVocabularyMetadataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCustomVocabularyMetadataInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeExportInput(v *DescribeExportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeExportInput"}
if v.ExportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeImportInput(v *DescribeImportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeImportInput"}
if v.ImportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeIntentInput(v *DescribeIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeIntentInput"}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeResourcePolicyInput(v *DescribeResourcePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeResourcePolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSlotInput(v *DescribeSlotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSlotInput"}
if v.SlotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSlotTypeInput(v *DescribeSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSlotTypeInput"}
if v.SlotTypeId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeId"))
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTestExecutionInput(v *DescribeTestExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTestExecutionInput"}
if v.TestExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTestSetDiscrepancyReportInput(v *DescribeTestSetDiscrepancyReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTestSetDiscrepancyReportInput"}
if v.TestSetDiscrepancyReportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetDiscrepancyReportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTestSetGenerationInput(v *DescribeTestSetGenerationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTestSetGenerationInput"}
if v.TestSetGenerationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetGenerationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTestSetInput(v *DescribeTestSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTestSetInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetTestExecutionArtifactsUrlInput(v *GetTestExecutionArtifactsUrlInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetTestExecutionArtifactsUrlInput"}
if v.TestExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAggregatedUtterancesInput(v *ListAggregatedUtterancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAggregatedUtterancesInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.AggregationDuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("AggregationDuration"))
} else if v.AggregationDuration != nil {
if err := validateUtteranceAggregationDuration(v.AggregationDuration); err != nil {
invalidParams.AddNested("AggregationDuration", err.(smithy.InvalidParamsError))
}
}
if v.SortBy != nil {
if err := validateAggregatedUtterancesSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateAggregatedUtterancesFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBotAliasesInput(v *ListBotAliasesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBotAliasesInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBotLocalesInput(v *ListBotLocalesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBotLocalesInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.SortBy != nil {
if err := validateBotLocaleSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateBotLocaleFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBotRecommendationsInput(v *ListBotRecommendationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBotRecommendationsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBotsInput(v *ListBotsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBotsInput"}
if v.SortBy != nil {
if err := validateBotSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateBotFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBotVersionsInput(v *ListBotVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBotVersionsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.SortBy != nil {
if err := validateBotVersionSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBuiltInIntentsInput(v *ListBuiltInIntentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBuiltInIntentsInput"}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SortBy != nil {
if err := validateBuiltInIntentSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBuiltInSlotTypesInput(v *ListBuiltInSlotTypesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBuiltInSlotTypesInput"}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SortBy != nil {
if err := validateBuiltInSlotTypeSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListCustomVocabularyItemsInput(v *ListCustomVocabularyItemsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListCustomVocabularyItemsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListExportsInput(v *ListExportsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListExportsInput"}
if v.SortBy != nil {
if err := validateExportSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateExportFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListImportsInput(v *ListImportsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListImportsInput"}
if v.SortBy != nil {
if err := validateImportSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateImportFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListIntentsInput(v *ListIntentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListIntentsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SortBy != nil {
if err := validateIntentSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateIntentFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListRecommendedIntentsInput(v *ListRecommendedIntentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListRecommendedIntentsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.BotRecommendationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotRecommendationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListSlotsInput(v *ListSlotsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListSlotsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.SortBy != nil {
if err := validateSlotSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateSlotFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListSlotTypesInput(v *ListSlotTypesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListSlotTypesInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SortBy != nil {
if err := validateSlotTypeSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if v.Filters != nil {
if err := validateSlotTypeFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTestExecutionResultItemsInput(v *ListTestExecutionResultItemsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTestExecutionResultItemsInput"}
if v.TestExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestExecutionId"))
}
if v.ResultFilterBy == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResultFilterBy"))
} else if v.ResultFilterBy != nil {
if err := validateTestExecutionResultFilterBy(v.ResultFilterBy); err != nil {
invalidParams.AddNested("ResultFilterBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTestExecutionsInput(v *ListTestExecutionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTestExecutionsInput"}
if v.SortBy != nil {
if err := validateTestExecutionSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTestSetRecordsInput(v *ListTestSetRecordsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTestSetRecordsInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTestSetsInput(v *ListTestSetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTestSetsInput"}
if v.SortBy != nil {
if err := validateTestSetSortBy(v.SortBy); err != nil {
invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchAssociatedTranscriptsInput(v *SearchAssociatedTranscriptsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchAssociatedTranscriptsInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.BotRecommendationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotRecommendationId"))
}
if v.Filters == nil {
invalidParams.Add(smithy.NewErrParamRequired("Filters"))
} else if v.Filters != nil {
if err := validateAssociatedTranscriptFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartBotRecommendationInput(v *StartBotRecommendationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartBotRecommendationInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.TranscriptSourceSetting == nil {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptSourceSetting"))
} else if v.TranscriptSourceSetting != nil {
if err := validateTranscriptSourceSetting(v.TranscriptSourceSetting); err != nil {
invalidParams.AddNested("TranscriptSourceSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartImportInput(v *StartImportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartImportInput"}
if v.ImportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportId"))
}
if v.ResourceSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceSpecification"))
} else if v.ResourceSpecification != nil {
if err := validateImportResourceSpecification(v.ResourceSpecification); err != nil {
invalidParams.AddNested("ResourceSpecification", err.(smithy.InvalidParamsError))
}
}
if len(v.MergeStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MergeStrategy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartTestExecutionInput(v *StartTestExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartTestExecutionInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if v.Target == nil {
invalidParams.Add(smithy.NewErrParamRequired("Target"))
} else if v.Target != nil {
if err := validateTestExecutionTarget(v.Target); err != nil {
invalidParams.AddNested("Target", err.(smithy.InvalidParamsError))
}
}
if len(v.ApiMode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ApiMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartTestSetGenerationInput(v *StartTestSetGenerationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartTestSetGenerationInput"}
if v.TestSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetName"))
}
if v.StorageLocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("StorageLocation"))
} else if v.StorageLocation != nil {
if err := validateTestSetStorageLocation(v.StorageLocation); err != nil {
invalidParams.AddNested("StorageLocation", err.(smithy.InvalidParamsError))
}
}
if v.GenerationDataSource == nil {
invalidParams.Add(smithy.NewErrParamRequired("GenerationDataSource"))
} else if v.GenerationDataSource != nil {
if err := validateTestSetGenerationDataSource(v.GenerationDataSource); err != nil {
invalidParams.AddNested("GenerationDataSource", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopBotRecommendationInput(v *StopBotRecommendationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopBotRecommendationInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.BotRecommendationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotRecommendationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBotAliasInput(v *UpdateBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBotAliasInput"}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.BotAliasName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasName"))
}
if v.BotAliasLocaleSettings != nil {
if err := validateBotAliasLocaleSettingsMap(v.BotAliasLocaleSettings); err != nil {
invalidParams.AddNested("BotAliasLocaleSettings", err.(smithy.InvalidParamsError))
}
}
if v.ConversationLogSettings != nil {
if err := validateConversationLogSettings(v.ConversationLogSettings); err != nil {
invalidParams.AddNested("ConversationLogSettings", err.(smithy.InvalidParamsError))
}
}
if v.SentimentAnalysisSettings != nil {
if err := validateSentimentAnalysisSettings(v.SentimentAnalysisSettings); err != nil {
invalidParams.AddNested("SentimentAnalysisSettings", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBotInput(v *UpdateBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBotInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.DataPrivacy == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataPrivacy"))
} else if v.DataPrivacy != nil {
if err := validateDataPrivacy(v.DataPrivacy); err != nil {
invalidParams.AddNested("DataPrivacy", err.(smithy.InvalidParamsError))
}
}
if v.IdleSessionTTLInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("IdleSessionTTLInSeconds"))
}
if v.BotMembers != nil {
if err := validateBotMembers(v.BotMembers); err != nil {
invalidParams.AddNested("BotMembers", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBotLocaleInput(v *UpdateBotLocaleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBotLocaleInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.NluIntentConfidenceThreshold == nil {
invalidParams.Add(smithy.NewErrParamRequired("NluIntentConfidenceThreshold"))
}
if v.VoiceSettings != nil {
if err := validateVoiceSettings(v.VoiceSettings); err != nil {
invalidParams.AddNested("VoiceSettings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBotRecommendationInput(v *UpdateBotRecommendationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBotRecommendationInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.BotRecommendationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotRecommendationId"))
}
if v.EncryptionSetting == nil {
invalidParams.Add(smithy.NewErrParamRequired("EncryptionSetting"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateExportInput(v *UpdateExportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExportInput"}
if v.ExportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateIntentInput(v *UpdateIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateIntentInput"}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.IntentName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentName"))
}
if v.SampleUtterances != nil {
if err := validateSampleUtterancesList(v.SampleUtterances); err != nil {
invalidParams.AddNested("SampleUtterances", err.(smithy.InvalidParamsError))
}
}
if v.DialogCodeHook != nil {
if err := validateDialogCodeHookSettings(v.DialogCodeHook); err != nil {
invalidParams.AddNested("DialogCodeHook", err.(smithy.InvalidParamsError))
}
}
if v.FulfillmentCodeHook != nil {
if err := validateFulfillmentCodeHookSettings(v.FulfillmentCodeHook); err != nil {
invalidParams.AddNested("FulfillmentCodeHook", err.(smithy.InvalidParamsError))
}
}
if v.SlotPriorities != nil {
if err := validateSlotPrioritiesList(v.SlotPriorities); err != nil {
invalidParams.AddNested("SlotPriorities", err.(smithy.InvalidParamsError))
}
}
if v.IntentConfirmationSetting != nil {
if err := validateIntentConfirmationSetting(v.IntentConfirmationSetting); err != nil {
invalidParams.AddNested("IntentConfirmationSetting", err.(smithy.InvalidParamsError))
}
}
if v.IntentClosingSetting != nil {
if err := validateIntentClosingSetting(v.IntentClosingSetting); err != nil {
invalidParams.AddNested("IntentClosingSetting", err.(smithy.InvalidParamsError))
}
}
if v.InputContexts != nil {
if err := validateInputContextsList(v.InputContexts); err != nil {
invalidParams.AddNested("InputContexts", err.(smithy.InvalidParamsError))
}
}
if v.OutputContexts != nil {
if err := validateOutputContextsList(v.OutputContexts); err != nil {
invalidParams.AddNested("OutputContexts", err.(smithy.InvalidParamsError))
}
}
if v.KendraConfiguration != nil {
if err := validateKendraConfiguration(v.KendraConfiguration); err != nil {
invalidParams.AddNested("KendraConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.InitialResponseSetting != nil {
if err := validateInitialResponseSetting(v.InitialResponseSetting); err != nil {
invalidParams.AddNested("InitialResponseSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateResourcePolicyInput(v *UpdateResourcePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateResourcePolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSlotInput(v *UpdateSlotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSlotInput"}
if v.SlotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotId"))
}
if v.SlotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotName"))
}
if v.ValueElicitationSetting == nil {
invalidParams.Add(smithy.NewErrParamRequired("ValueElicitationSetting"))
} else if v.ValueElicitationSetting != nil {
if err := validateSlotValueElicitationSetting(v.ValueElicitationSetting); err != nil {
invalidParams.AddNested("ValueElicitationSetting", err.(smithy.InvalidParamsError))
}
}
if v.ObfuscationSetting != nil {
if err := validateObfuscationSetting(v.ObfuscationSetting); err != nil {
invalidParams.AddNested("ObfuscationSetting", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.IntentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentId"))
}
if v.SubSlotSetting != nil {
if err := validateSubSlotSetting(v.SubSlotSetting); err != nil {
invalidParams.AddNested("SubSlotSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSlotTypeInput(v *UpdateSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSlotTypeInput"}
if v.SlotTypeId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeId"))
}
if v.SlotTypeName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SlotTypeName"))
}
if v.SlotTypeValues != nil {
if err := validateSlotTypeValues(v.SlotTypeValues); err != nil {
invalidParams.AddNested("SlotTypeValues", err.(smithy.InvalidParamsError))
}
}
if v.ValueSelectionSetting != nil {
if err := validateSlotValueSelectionSetting(v.ValueSelectionSetting); err != nil {
invalidParams.AddNested("ValueSelectionSetting", err.(smithy.InvalidParamsError))
}
}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.ExternalSourceSetting != nil {
if err := validateExternalSourceSetting(v.ExternalSourceSetting); err != nil {
invalidParams.AddNested("ExternalSourceSetting", err.(smithy.InvalidParamsError))
}
}
if v.CompositeSlotTypeSetting != nil {
if err := validateCompositeSlotTypeSetting(v.CompositeSlotTypeSetting); err != nil {
invalidParams.AddNested("CompositeSlotTypeSetting", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateTestSetInput(v *UpdateTestSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateTestSetInput"}
if v.TestSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetId"))
}
if v.TestSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TestSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 7,254 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Lex Models V2 endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models-v2-lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models-v2-lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 332 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AggregatedUtterancesFilterName string
// Enum values for AggregatedUtterancesFilterName
const (
AggregatedUtterancesFilterNameUtterance AggregatedUtterancesFilterName = "Utterance"
)
// Values returns all known values for AggregatedUtterancesFilterName. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (AggregatedUtterancesFilterName) Values() []AggregatedUtterancesFilterName {
return []AggregatedUtterancesFilterName{
"Utterance",
}
}
type AggregatedUtterancesFilterOperator string
// Enum values for AggregatedUtterancesFilterOperator
const (
AggregatedUtterancesFilterOperatorContains AggregatedUtterancesFilterOperator = "CO"
AggregatedUtterancesFilterOperatorEquals AggregatedUtterancesFilterOperator = "EQ"
)
// Values returns all known values for AggregatedUtterancesFilterOperator. Note
// that this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (AggregatedUtterancesFilterOperator) Values() []AggregatedUtterancesFilterOperator {
return []AggregatedUtterancesFilterOperator{
"CO",
"EQ",
}
}
type AggregatedUtterancesSortAttribute string
// Enum values for AggregatedUtterancesSortAttribute
const (
AggregatedUtterancesSortAttributeHitCount AggregatedUtterancesSortAttribute = "HitCount"
AggregatedUtterancesSortAttributeMissedCount AggregatedUtterancesSortAttribute = "MissedCount"
)
// Values returns all known values for AggregatedUtterancesSortAttribute. Note
// that this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (AggregatedUtterancesSortAttribute) Values() []AggregatedUtterancesSortAttribute {
return []AggregatedUtterancesSortAttribute{
"HitCount",
"MissedCount",
}
}
type AssociatedTranscriptFilterName string
// Enum values for AssociatedTranscriptFilterName
const (
AssociatedTranscriptFilterNameIntentId AssociatedTranscriptFilterName = "IntentId"
AssociatedTranscriptFilterNameSlotTypeId AssociatedTranscriptFilterName = "SlotTypeId"
)
// Values returns all known values for AssociatedTranscriptFilterName. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (AssociatedTranscriptFilterName) Values() []AssociatedTranscriptFilterName {
return []AssociatedTranscriptFilterName{
"IntentId",
"SlotTypeId",
}
}
type AudioRecognitionStrategy string
// Enum values for AudioRecognitionStrategy
const (
AudioRecognitionStrategyUseSlotValuesAsCustomVocabulary AudioRecognitionStrategy = "UseSlotValuesAsCustomVocabulary"
)
// Values returns all known values for AudioRecognitionStrategy. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (AudioRecognitionStrategy) Values() []AudioRecognitionStrategy {
return []AudioRecognitionStrategy{
"UseSlotValuesAsCustomVocabulary",
}
}
type BotAliasStatus string
// Enum values for BotAliasStatus
const (
BotAliasStatusCreating BotAliasStatus = "Creating"
BotAliasStatusAvailable BotAliasStatus = "Available"
BotAliasStatusDeleting BotAliasStatus = "Deleting"
BotAliasStatusFailed BotAliasStatus = "Failed"
)
// Values returns all known values for BotAliasStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotAliasStatus) Values() []BotAliasStatus {
return []BotAliasStatus{
"Creating",
"Available",
"Deleting",
"Failed",
}
}
type BotFilterName string
// Enum values for BotFilterName
const (
BotFilterNameBotName BotFilterName = "BotName"
BotFilterNameBotType BotFilterName = "BotType"
)
// Values returns all known values for BotFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotFilterName) Values() []BotFilterName {
return []BotFilterName{
"BotName",
"BotType",
}
}
type BotFilterOperator string
// Enum values for BotFilterOperator
const (
BotFilterOperatorContains BotFilterOperator = "CO"
BotFilterOperatorEquals BotFilterOperator = "EQ"
BotFilterOperatorNotEquals BotFilterOperator = "NE"
)
// Values returns all known values for BotFilterOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotFilterOperator) Values() []BotFilterOperator {
return []BotFilterOperator{
"CO",
"EQ",
"NE",
}
}
type BotLocaleFilterName string
// Enum values for BotLocaleFilterName
const (
BotLocaleFilterNameBotLocaleName BotLocaleFilterName = "BotLocaleName"
)
// Values returns all known values for BotLocaleFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotLocaleFilterName) Values() []BotLocaleFilterName {
return []BotLocaleFilterName{
"BotLocaleName",
}
}
type BotLocaleFilterOperator string
// Enum values for BotLocaleFilterOperator
const (
BotLocaleFilterOperatorContains BotLocaleFilterOperator = "CO"
BotLocaleFilterOperatorEquals BotLocaleFilterOperator = "EQ"
)
// Values returns all known values for BotLocaleFilterOperator. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotLocaleFilterOperator) Values() []BotLocaleFilterOperator {
return []BotLocaleFilterOperator{
"CO",
"EQ",
}
}
type BotLocaleSortAttribute string
// Enum values for BotLocaleSortAttribute
const (
BotLocaleSortAttributeBotLocaleName BotLocaleSortAttribute = "BotLocaleName"
)
// Values returns all known values for BotLocaleSortAttribute. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotLocaleSortAttribute) Values() []BotLocaleSortAttribute {
return []BotLocaleSortAttribute{
"BotLocaleName",
}
}
type BotLocaleStatus string
// Enum values for BotLocaleStatus
const (
BotLocaleStatusCreating BotLocaleStatus = "Creating"
BotLocaleStatusBuilding BotLocaleStatus = "Building"
BotLocaleStatusBuilt BotLocaleStatus = "Built"
BotLocaleStatusReadyExpressTesting BotLocaleStatus = "ReadyExpressTesting"
BotLocaleStatusFailed BotLocaleStatus = "Failed"
BotLocaleStatusDeleting BotLocaleStatus = "Deleting"
BotLocaleStatusNotBuilt BotLocaleStatus = "NotBuilt"
BotLocaleStatusImporting BotLocaleStatus = "Importing"
BotLocaleStatusProcessing BotLocaleStatus = "Processing"
)
// Values returns all known values for BotLocaleStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotLocaleStatus) Values() []BotLocaleStatus {
return []BotLocaleStatus{
"Creating",
"Building",
"Built",
"ReadyExpressTesting",
"Failed",
"Deleting",
"NotBuilt",
"Importing",
"Processing",
}
}
type BotRecommendationStatus string
// Enum values for BotRecommendationStatus
const (
BotRecommendationStatusProcessing BotRecommendationStatus = "Processing"
BotRecommendationStatusDeleting BotRecommendationStatus = "Deleting"
BotRecommendationStatusDeleted BotRecommendationStatus = "Deleted"
BotRecommendationStatusDownloading BotRecommendationStatus = "Downloading"
BotRecommendationStatusUpdating BotRecommendationStatus = "Updating"
BotRecommendationStatusAvailable BotRecommendationStatus = "Available"
BotRecommendationStatusFailed BotRecommendationStatus = "Failed"
BotRecommendationStatusStopping BotRecommendationStatus = "Stopping"
BotRecommendationStatusStopped BotRecommendationStatus = "Stopped"
)
// Values returns all known values for BotRecommendationStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotRecommendationStatus) Values() []BotRecommendationStatus {
return []BotRecommendationStatus{
"Processing",
"Deleting",
"Deleted",
"Downloading",
"Updating",
"Available",
"Failed",
"Stopping",
"Stopped",
}
}
type BotSortAttribute string
// Enum values for BotSortAttribute
const (
BotSortAttributeBotName BotSortAttribute = "BotName"
)
// Values returns all known values for BotSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotSortAttribute) Values() []BotSortAttribute {
return []BotSortAttribute{
"BotName",
}
}
type BotStatus string
// Enum values for BotStatus
const (
BotStatusCreating BotStatus = "Creating"
BotStatusAvailable BotStatus = "Available"
BotStatusInactive BotStatus = "Inactive"
BotStatusDeleting BotStatus = "Deleting"
BotStatusFailed BotStatus = "Failed"
BotStatusVersioning BotStatus = "Versioning"
BotStatusImporting BotStatus = "Importing"
BotStatusUpdating BotStatus = "Updating"
)
// Values returns all known values for BotStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (BotStatus) Values() []BotStatus {
return []BotStatus{
"Creating",
"Available",
"Inactive",
"Deleting",
"Failed",
"Versioning",
"Importing",
"Updating",
}
}
type BotType string
// Enum values for BotType
const (
BotTypeBot BotType = "Bot"
BotTypeBotNetwork BotType = "BotNetwork"
)
// Values returns all known values for BotType. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (BotType) Values() []BotType {
return []BotType{
"Bot",
"BotNetwork",
}
}
type BotVersionSortAttribute string
// Enum values for BotVersionSortAttribute
const (
BotVersionSortAttributeBotVersion BotVersionSortAttribute = "BotVersion"
)
// Values returns all known values for BotVersionSortAttribute. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BotVersionSortAttribute) Values() []BotVersionSortAttribute {
return []BotVersionSortAttribute{
"BotVersion",
}
}
type BuiltInIntentSortAttribute string
// Enum values for BuiltInIntentSortAttribute
const (
BuiltInIntentSortAttributeIntentSignature BuiltInIntentSortAttribute = "IntentSignature"
)
// Values returns all known values for BuiltInIntentSortAttribute. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (BuiltInIntentSortAttribute) Values() []BuiltInIntentSortAttribute {
return []BuiltInIntentSortAttribute{
"IntentSignature",
}
}
type BuiltInSlotTypeSortAttribute string
// Enum values for BuiltInSlotTypeSortAttribute
const (
BuiltInSlotTypeSortAttributeSlotTypeSignature BuiltInSlotTypeSortAttribute = "SlotTypeSignature"
)
// Values returns all known values for BuiltInSlotTypeSortAttribute. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (BuiltInSlotTypeSortAttribute) Values() []BuiltInSlotTypeSortAttribute {
return []BuiltInSlotTypeSortAttribute{
"SlotTypeSignature",
}
}
type ConversationLogsInputModeFilter string
// Enum values for ConversationLogsInputModeFilter
const (
ConversationLogsInputModeFilterSpeech ConversationLogsInputModeFilter = "Speech"
ConversationLogsInputModeFilterText ConversationLogsInputModeFilter = "Text"
)
// Values returns all known values for ConversationLogsInputModeFilter. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (ConversationLogsInputModeFilter) Values() []ConversationLogsInputModeFilter {
return []ConversationLogsInputModeFilter{
"Speech",
"Text",
}
}
type CustomVocabularyStatus string
// Enum values for CustomVocabularyStatus
const (
CustomVocabularyStatusReady CustomVocabularyStatus = "Ready"
CustomVocabularyStatusDeleting CustomVocabularyStatus = "Deleting"
CustomVocabularyStatusExporting CustomVocabularyStatus = "Exporting"
CustomVocabularyStatusImporting CustomVocabularyStatus = "Importing"
CustomVocabularyStatusCreating CustomVocabularyStatus = "Creating"
)
// Values returns all known values for CustomVocabularyStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (CustomVocabularyStatus) Values() []CustomVocabularyStatus {
return []CustomVocabularyStatus{
"Ready",
"Deleting",
"Exporting",
"Importing",
"Creating",
}
}
type DialogActionType string
// Enum values for DialogActionType
const (
DialogActionTypeElicitIntent DialogActionType = "ElicitIntent"
DialogActionTypeStartIntent DialogActionType = "StartIntent"
DialogActionTypeElicitSlot DialogActionType = "ElicitSlot"
DialogActionTypeEvaluateConditional DialogActionType = "EvaluateConditional"
DialogActionTypeInvokeDialogCodeHook DialogActionType = "InvokeDialogCodeHook"
DialogActionTypeConfirmIntent DialogActionType = "ConfirmIntent"
DialogActionTypeFulfillIntent DialogActionType = "FulfillIntent"
DialogActionTypeCloseIntent DialogActionType = "CloseIntent"
DialogActionTypeEndConversation DialogActionType = "EndConversation"
)
// Values returns all known values for DialogActionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DialogActionType) Values() []DialogActionType {
return []DialogActionType{
"ElicitIntent",
"StartIntent",
"ElicitSlot",
"EvaluateConditional",
"InvokeDialogCodeHook",
"ConfirmIntent",
"FulfillIntent",
"CloseIntent",
"EndConversation",
}
}
type Effect string
// Enum values for Effect
const (
EffectAllow Effect = "Allow"
EffectDeny Effect = "Deny"
)
// Values returns all known values for Effect. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Effect) Values() []Effect {
return []Effect{
"Allow",
"Deny",
}
}
type ErrorCode string
// Enum values for ErrorCode
const (
ErrorCodeDuplicateInput ErrorCode = "DUPLICATE_INPUT"
ErrorCodeResourceDoesNotExist ErrorCode = "RESOURCE_DOES_NOT_EXIST"
ErrorCodeResourceAlreadyExists ErrorCode = "RESOURCE_ALREADY_EXISTS"
ErrorCodeInternalServerFailure ErrorCode = "INTERNAL_SERVER_FAILURE"
)
// Values returns all known values for ErrorCode. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ErrorCode) Values() []ErrorCode {
return []ErrorCode{
"DUPLICATE_INPUT",
"RESOURCE_DOES_NOT_EXIST",
"RESOURCE_ALREADY_EXISTS",
"INTERNAL_SERVER_FAILURE",
}
}
type ExportFilterName string
// Enum values for ExportFilterName
const (
ExportFilterNameExportResourceType ExportFilterName = "ExportResourceType"
)
// Values returns all known values for ExportFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ExportFilterName) Values() []ExportFilterName {
return []ExportFilterName{
"ExportResourceType",
}
}
type ExportFilterOperator string
// Enum values for ExportFilterOperator
const (
ExportFilterOperatorContains ExportFilterOperator = "CO"
ExportFilterOperatorEquals ExportFilterOperator = "EQ"
)
// Values returns all known values for ExportFilterOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ExportFilterOperator) Values() []ExportFilterOperator {
return []ExportFilterOperator{
"CO",
"EQ",
}
}
type ExportSortAttribute string
// Enum values for ExportSortAttribute
const (
ExportSortAttributeLastUpdatedDateTime ExportSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for ExportSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ExportSortAttribute) Values() []ExportSortAttribute {
return []ExportSortAttribute{
"LastUpdatedDateTime",
}
}
type ExportStatus string
// Enum values for ExportStatus
const (
ExportStatusInProgress ExportStatus = "InProgress"
ExportStatusCompleted ExportStatus = "Completed"
ExportStatusFailed ExportStatus = "Failed"
ExportStatusDeleting ExportStatus = "Deleting"
)
// Values returns all known values for ExportStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ExportStatus) Values() []ExportStatus {
return []ExportStatus{
"InProgress",
"Completed",
"Failed",
"Deleting",
}
}
type ImportExportFileFormat string
// Enum values for ImportExportFileFormat
const (
ImportExportFileFormatLexJson ImportExportFileFormat = "LexJson"
ImportExportFileFormatTsv ImportExportFileFormat = "TSV"
ImportExportFileFormatCsv ImportExportFileFormat = "CSV"
)
// Values returns all known values for ImportExportFileFormat. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportExportFileFormat) Values() []ImportExportFileFormat {
return []ImportExportFileFormat{
"LexJson",
"TSV",
"CSV",
}
}
type ImportFilterName string
// Enum values for ImportFilterName
const (
ImportFilterNameImportResourceType ImportFilterName = "ImportResourceType"
)
// Values returns all known values for ImportFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportFilterName) Values() []ImportFilterName {
return []ImportFilterName{
"ImportResourceType",
}
}
type ImportFilterOperator string
// Enum values for ImportFilterOperator
const (
ImportFilterOperatorContains ImportFilterOperator = "CO"
ImportFilterOperatorEquals ImportFilterOperator = "EQ"
)
// Values returns all known values for ImportFilterOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportFilterOperator) Values() []ImportFilterOperator {
return []ImportFilterOperator{
"CO",
"EQ",
}
}
type ImportResourceType string
// Enum values for ImportResourceType
const (
ImportResourceTypeBot ImportResourceType = "Bot"
ImportResourceTypeBotLocale ImportResourceType = "BotLocale"
ImportResourceTypeCustomVocabulary ImportResourceType = "CustomVocabulary"
ImportResourceTypeTestSet ImportResourceType = "TestSet"
)
// Values returns all known values for ImportResourceType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportResourceType) Values() []ImportResourceType {
return []ImportResourceType{
"Bot",
"BotLocale",
"CustomVocabulary",
"TestSet",
}
}
type ImportSortAttribute string
// Enum values for ImportSortAttribute
const (
ImportSortAttributeLastUpdatedDateTime ImportSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for ImportSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportSortAttribute) Values() []ImportSortAttribute {
return []ImportSortAttribute{
"LastUpdatedDateTime",
}
}
type ImportStatus string
// Enum values for ImportStatus
const (
ImportStatusInProgress ImportStatus = "InProgress"
ImportStatusCompleted ImportStatus = "Completed"
ImportStatusFailed ImportStatus = "Failed"
ImportStatusDeleting ImportStatus = "Deleting"
)
// Values returns all known values for ImportStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ImportStatus) Values() []ImportStatus {
return []ImportStatus{
"InProgress",
"Completed",
"Failed",
"Deleting",
}
}
type IntentFilterName string
// Enum values for IntentFilterName
const (
IntentFilterNameIntentName IntentFilterName = "IntentName"
)
// Values returns all known values for IntentFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IntentFilterName) Values() []IntentFilterName {
return []IntentFilterName{
"IntentName",
}
}
type IntentFilterOperator string
// Enum values for IntentFilterOperator
const (
IntentFilterOperatorContains IntentFilterOperator = "CO"
IntentFilterOperatorEquals IntentFilterOperator = "EQ"
)
// Values returns all known values for IntentFilterOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IntentFilterOperator) Values() []IntentFilterOperator {
return []IntentFilterOperator{
"CO",
"EQ",
}
}
type IntentSortAttribute string
// Enum values for IntentSortAttribute
const (
IntentSortAttributeIntentName IntentSortAttribute = "IntentName"
IntentSortAttributeLastUpdatedDateTime IntentSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for IntentSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IntentSortAttribute) Values() []IntentSortAttribute {
return []IntentSortAttribute{
"IntentName",
"LastUpdatedDateTime",
}
}
type MergeStrategy string
// Enum values for MergeStrategy
const (
MergeStrategyOverwrite MergeStrategy = "Overwrite"
MergeStrategyFailOnConflict MergeStrategy = "FailOnConflict"
MergeStrategyAppend MergeStrategy = "Append"
)
// Values returns all known values for MergeStrategy. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MergeStrategy) Values() []MergeStrategy {
return []MergeStrategy{
"Overwrite",
"FailOnConflict",
"Append",
}
}
type MessageSelectionStrategy string
// Enum values for MessageSelectionStrategy
const (
MessageSelectionStrategyRandom MessageSelectionStrategy = "Random"
MessageSelectionStrategyOrdered MessageSelectionStrategy = "Ordered"
)
// Values returns all known values for MessageSelectionStrategy. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (MessageSelectionStrategy) Values() []MessageSelectionStrategy {
return []MessageSelectionStrategy{
"Random",
"Ordered",
}
}
type ObfuscationSettingType string
// Enum values for ObfuscationSettingType
const (
ObfuscationSettingTypeNone ObfuscationSettingType = "None"
ObfuscationSettingTypeDefaultObfuscation ObfuscationSettingType = "DefaultObfuscation"
)
// Values returns all known values for ObfuscationSettingType. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ObfuscationSettingType) Values() []ObfuscationSettingType {
return []ObfuscationSettingType{
"None",
"DefaultObfuscation",
}
}
type PromptAttempt string
// Enum values for PromptAttempt
const (
PromptAttemptInitial PromptAttempt = "Initial"
PromptAttemptRetry1 PromptAttempt = "Retry1"
PromptAttemptRetry2 PromptAttempt = "Retry2"
PromptAttemptRetry3 PromptAttempt = "Retry3"
PromptAttemptRetry4 PromptAttempt = "Retry4"
PromptAttemptRetry5 PromptAttempt = "Retry5"
)
// Values returns all known values for PromptAttempt. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PromptAttempt) Values() []PromptAttempt {
return []PromptAttempt{
"Initial",
"Retry1",
"Retry2",
"Retry3",
"Retry4",
"Retry5",
}
}
type SearchOrder string
// Enum values for SearchOrder
const (
SearchOrderAscending SearchOrder = "Ascending"
SearchOrderDescending SearchOrder = "Descending"
)
// Values returns all known values for SearchOrder. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (SearchOrder) Values() []SearchOrder {
return []SearchOrder{
"Ascending",
"Descending",
}
}
type SlotConstraint string
// Enum values for SlotConstraint
const (
SlotConstraintRequired SlotConstraint = "Required"
SlotConstraintOptional SlotConstraint = "Optional"
)
// Values returns all known values for SlotConstraint. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotConstraint) Values() []SlotConstraint {
return []SlotConstraint{
"Required",
"Optional",
}
}
type SlotFilterName string
// Enum values for SlotFilterName
const (
SlotFilterNameSlotName SlotFilterName = "SlotName"
)
// Values returns all known values for SlotFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotFilterName) Values() []SlotFilterName {
return []SlotFilterName{
"SlotName",
}
}
type SlotFilterOperator string
// Enum values for SlotFilterOperator
const (
SlotFilterOperatorContains SlotFilterOperator = "CO"
SlotFilterOperatorEquals SlotFilterOperator = "EQ"
)
// Values returns all known values for SlotFilterOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotFilterOperator) Values() []SlotFilterOperator {
return []SlotFilterOperator{
"CO",
"EQ",
}
}
type SlotShape string
// Enum values for SlotShape
const (
SlotShapeScalar SlotShape = "Scalar"
SlotShapeList SlotShape = "List"
)
// Values returns all known values for SlotShape. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (SlotShape) Values() []SlotShape {
return []SlotShape{
"Scalar",
"List",
}
}
type SlotSortAttribute string
// Enum values for SlotSortAttribute
const (
SlotSortAttributeSlotName SlotSortAttribute = "SlotName"
SlotSortAttributeLastUpdatedDateTime SlotSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for SlotSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotSortAttribute) Values() []SlotSortAttribute {
return []SlotSortAttribute{
"SlotName",
"LastUpdatedDateTime",
}
}
type SlotTypeCategory string
// Enum values for SlotTypeCategory
const (
SlotTypeCategoryCustom SlotTypeCategory = "Custom"
SlotTypeCategoryExtended SlotTypeCategory = "Extended"
SlotTypeCategoryExternalGrammar SlotTypeCategory = "ExternalGrammar"
SlotTypeCategoryComposite SlotTypeCategory = "Composite"
)
// Values returns all known values for SlotTypeCategory. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotTypeCategory) Values() []SlotTypeCategory {
return []SlotTypeCategory{
"Custom",
"Extended",
"ExternalGrammar",
"Composite",
}
}
type SlotTypeFilterName string
// Enum values for SlotTypeFilterName
const (
SlotTypeFilterNameSlotTypeName SlotTypeFilterName = "SlotTypeName"
SlotTypeFilterNameExternalSourceType SlotTypeFilterName = "ExternalSourceType"
)
// Values returns all known values for SlotTypeFilterName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotTypeFilterName) Values() []SlotTypeFilterName {
return []SlotTypeFilterName{
"SlotTypeName",
"ExternalSourceType",
}
}
type SlotTypeFilterOperator string
// Enum values for SlotTypeFilterOperator
const (
SlotTypeFilterOperatorContains SlotTypeFilterOperator = "CO"
SlotTypeFilterOperatorEquals SlotTypeFilterOperator = "EQ"
)
// Values returns all known values for SlotTypeFilterOperator. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotTypeFilterOperator) Values() []SlotTypeFilterOperator {
return []SlotTypeFilterOperator{
"CO",
"EQ",
}
}
type SlotTypeSortAttribute string
// Enum values for SlotTypeSortAttribute
const (
SlotTypeSortAttributeSlotTypeName SlotTypeSortAttribute = "SlotTypeName"
SlotTypeSortAttributeLastUpdatedDateTime SlotTypeSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for SlotTypeSortAttribute. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SlotTypeSortAttribute) Values() []SlotTypeSortAttribute {
return []SlotTypeSortAttribute{
"SlotTypeName",
"LastUpdatedDateTime",
}
}
type SlotValueResolutionStrategy string
// Enum values for SlotValueResolutionStrategy
const (
SlotValueResolutionStrategyOriginalValue SlotValueResolutionStrategy = "OriginalValue"
SlotValueResolutionStrategyTopResolution SlotValueResolutionStrategy = "TopResolution"
SlotValueResolutionStrategyConcatenation SlotValueResolutionStrategy = "Concatenation"
)
// Values returns all known values for SlotValueResolutionStrategy. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (SlotValueResolutionStrategy) Values() []SlotValueResolutionStrategy {
return []SlotValueResolutionStrategy{
"OriginalValue",
"TopResolution",
"Concatenation",
}
}
type SortOrder string
// Enum values for SortOrder
const (
SortOrderAscending SortOrder = "Ascending"
SortOrderDescending SortOrder = "Descending"
)
// Values returns all known values for SortOrder. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (SortOrder) Values() []SortOrder {
return []SortOrder{
"Ascending",
"Descending",
}
}
type TestExecutionApiMode string
// Enum values for TestExecutionApiMode
const (
TestExecutionApiModeStreaming TestExecutionApiMode = "Streaming"
TestExecutionApiModeNonStreaming TestExecutionApiMode = "NonStreaming"
)
// Values returns all known values for TestExecutionApiMode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestExecutionApiMode) Values() []TestExecutionApiMode {
return []TestExecutionApiMode{
"Streaming",
"NonStreaming",
}
}
type TestExecutionModality string
// Enum values for TestExecutionModality
const (
TestExecutionModalityText TestExecutionModality = "Text"
TestExecutionModalityAudio TestExecutionModality = "Audio"
)
// Values returns all known values for TestExecutionModality. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestExecutionModality) Values() []TestExecutionModality {
return []TestExecutionModality{
"Text",
"Audio",
}
}
type TestExecutionSortAttribute string
// Enum values for TestExecutionSortAttribute
const (
TestExecutionSortAttributeTestSetName TestExecutionSortAttribute = "TestSetName"
TestExecutionSortAttributeCreationDateTime TestExecutionSortAttribute = "CreationDateTime"
)
// Values returns all known values for TestExecutionSortAttribute. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (TestExecutionSortAttribute) Values() []TestExecutionSortAttribute {
return []TestExecutionSortAttribute{
"TestSetName",
"CreationDateTime",
}
}
type TestExecutionStatus string
// Enum values for TestExecutionStatus
const (
TestExecutionStatusPending TestExecutionStatus = "Pending"
TestExecutionStatusWaiting TestExecutionStatus = "Waiting"
TestExecutionStatusInProgress TestExecutionStatus = "InProgress"
TestExecutionStatusCompleted TestExecutionStatus = "Completed"
TestExecutionStatusFailed TestExecutionStatus = "Failed"
TestExecutionStatusStopping TestExecutionStatus = "Stopping"
TestExecutionStatusStopped TestExecutionStatus = "Stopped"
)
// Values returns all known values for TestExecutionStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestExecutionStatus) Values() []TestExecutionStatus {
return []TestExecutionStatus{
"Pending",
"Waiting",
"InProgress",
"Completed",
"Failed",
"Stopping",
"Stopped",
}
}
type TestResultMatchStatus string
// Enum values for TestResultMatchStatus
const (
TestResultMatchStatusMatched TestResultMatchStatus = "Matched"
TestResultMatchStatusMismatched TestResultMatchStatus = "Mismatched"
TestResultMatchStatusExecutionError TestResultMatchStatus = "ExecutionError"
)
// Values returns all known values for TestResultMatchStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestResultMatchStatus) Values() []TestResultMatchStatus {
return []TestResultMatchStatus{
"Matched",
"Mismatched",
"ExecutionError",
}
}
type TestResultTypeFilter string
// Enum values for TestResultTypeFilter
const (
TestResultTypeFilterOverallTestResults TestResultTypeFilter = "OverallTestResults"
TestResultTypeFilterConversationLevelTestResults TestResultTypeFilter = "ConversationLevelTestResults"
TestResultTypeFilterIntentClassificationTestResults TestResultTypeFilter = "IntentClassificationTestResults"
TestResultTypeFilterSlotResolutionTestResults TestResultTypeFilter = "SlotResolutionTestResults"
TestResultTypeFilterUtteranceLevelResults TestResultTypeFilter = "UtteranceLevelResults"
)
// Values returns all known values for TestResultTypeFilter. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestResultTypeFilter) Values() []TestResultTypeFilter {
return []TestResultTypeFilter{
"OverallTestResults",
"ConversationLevelTestResults",
"IntentClassificationTestResults",
"SlotResolutionTestResults",
"UtteranceLevelResults",
}
}
type TestSetDiscrepancyReportStatus string
// Enum values for TestSetDiscrepancyReportStatus
const (
TestSetDiscrepancyReportStatusInProgress TestSetDiscrepancyReportStatus = "InProgress"
TestSetDiscrepancyReportStatusCompleted TestSetDiscrepancyReportStatus = "Completed"
TestSetDiscrepancyReportStatusFailed TestSetDiscrepancyReportStatus = "Failed"
)
// Values returns all known values for TestSetDiscrepancyReportStatus. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (TestSetDiscrepancyReportStatus) Values() []TestSetDiscrepancyReportStatus {
return []TestSetDiscrepancyReportStatus{
"InProgress",
"Completed",
"Failed",
}
}
type TestSetGenerationStatus string
// Enum values for TestSetGenerationStatus
const (
TestSetGenerationStatusGenerating TestSetGenerationStatus = "Generating"
TestSetGenerationStatusReady TestSetGenerationStatus = "Ready"
TestSetGenerationStatusFailed TestSetGenerationStatus = "Failed"
TestSetGenerationStatusPending TestSetGenerationStatus = "Pending"
)
// Values returns all known values for TestSetGenerationStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestSetGenerationStatus) Values() []TestSetGenerationStatus {
return []TestSetGenerationStatus{
"Generating",
"Ready",
"Failed",
"Pending",
}
}
type TestSetModality string
// Enum values for TestSetModality
const (
TestSetModalityText TestSetModality = "Text"
TestSetModalityAudio TestSetModality = "Audio"
)
// Values returns all known values for TestSetModality. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestSetModality) Values() []TestSetModality {
return []TestSetModality{
"Text",
"Audio",
}
}
type TestSetSortAttribute string
// Enum values for TestSetSortAttribute
const (
TestSetSortAttributeTestSetName TestSetSortAttribute = "TestSetName"
TestSetSortAttributeLastUpdatedDateTime TestSetSortAttribute = "LastUpdatedDateTime"
)
// Values returns all known values for TestSetSortAttribute. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestSetSortAttribute) Values() []TestSetSortAttribute {
return []TestSetSortAttribute{
"TestSetName",
"LastUpdatedDateTime",
}
}
type TestSetStatus string
// Enum values for TestSetStatus
const (
TestSetStatusImporting TestSetStatus = "Importing"
TestSetStatusPendingAnnotation TestSetStatus = "PendingAnnotation"
TestSetStatusDeleting TestSetStatus = "Deleting"
TestSetStatusValidationError TestSetStatus = "ValidationError"
TestSetStatusReady TestSetStatus = "Ready"
)
// Values returns all known values for TestSetStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TestSetStatus) Values() []TestSetStatus {
return []TestSetStatus{
"Importing",
"PendingAnnotation",
"Deleting",
"ValidationError",
"Ready",
}
}
type TimeDimension string
// Enum values for TimeDimension
const (
TimeDimensionHours TimeDimension = "Hours"
TimeDimensionDays TimeDimension = "Days"
TimeDimensionWeeks TimeDimension = "Weeks"
)
// Values returns all known values for TimeDimension. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TimeDimension) Values() []TimeDimension {
return []TimeDimension{
"Hours",
"Days",
"Weeks",
}
}
type TranscriptFormat string
// Enum values for TranscriptFormat
const (
TranscriptFormatLex TranscriptFormat = "Lex"
)
// Values returns all known values for TranscriptFormat. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TranscriptFormat) Values() []TranscriptFormat {
return []TranscriptFormat{
"Lex",
}
}
type VoiceEngine string
// Enum values for VoiceEngine
const (
VoiceEngineStandard VoiceEngine = "standard"
VoiceEngineNeural VoiceEngine = "neural"
)
// Values returns all known values for VoiceEngine. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (VoiceEngine) Values() []VoiceEngine {
return []VoiceEngine{
"standard",
"neural",
}
}
| 1,319 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// The action that you tried to perform couldn't be completed because the resource
// is in a conflicting state. For example, deleting a bot that is in the CREATING
// state. Try your request again.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The service encountered an unexpected condition. Try your request again.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Your request couldn't be completed because one or more request fields aren't
// valid. Check the fields in your request and try again.
type PreconditionFailedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *PreconditionFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PreconditionFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PreconditionFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PreconditionFailedException"
}
return *e.ErrorCodeOverride
}
func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You asked to describe a resource that doesn't exist. Check the resource that
// you are requesting and try again.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have reached a quota for your bot.
type ServiceQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceQuotaExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceQuotaExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceQuotaExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceQuotaExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Your request rate is too high. Reduce the frequency of requests.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
RetryAfterSeconds int32
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// One of the input parameters in your request isn't valid. Check the parameters
// and try your request again.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Lex Runtime Service"
const ServiceAPIVersion = "2016-11-28"
// Client provides the API client to make operations call for Amazon Lex Runtime
// Service.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "lexruntimeservice", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes session information for a specified bot, alias, and user ID.
func (c *Client) DeleteSession(ctx context.Context, params *DeleteSessionInput, optFns ...func(*Options)) (*DeleteSessionOutput, error) {
if params == nil {
params = &DeleteSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSession", params, optFns, c.addOperationDeleteSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSessionInput struct {
// The alias in use for the bot that contains the session data.
//
// This member is required.
BotAlias *string
// The name of the bot that contains the session data.
//
// This member is required.
BotName *string
// The identifier of the user associated with the session data.
//
// This member is required.
UserId *string
noSmithyDocumentSerde
}
type DeleteSessionOutput struct {
// The alias in use for the bot associated with the session data.
BotAlias *string
// The name of the bot associated with the session data.
BotName *string
// The unique identifier for the session.
SessionId *string
// The ID of the client application user.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSession",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns session information for a specified bot, alias, and user ID.
func (c *Client) GetSession(ctx context.Context, params *GetSessionInput, optFns ...func(*Options)) (*GetSessionOutput, error) {
if params == nil {
params = &GetSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSession", params, optFns, c.addOperationGetSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSessionInput struct {
// The alias in use for the bot that contains the session data.
//
// This member is required.
BotAlias *string
// The name of the bot that contains the session data.
//
// This member is required.
BotName *string
// The ID of the client application user. Amazon Lex uses this to identify a
// user's conversation with your bot.
//
// This member is required.
UserId *string
// A string used to filter the intents returned in the recentIntentSummaryView
// structure. When you specify a filter, only intents with their checkpointLabel
// field set to that string are returned.
CheckpointLabelFilter *string
noSmithyDocumentSerde
}
type GetSessionOutput struct {
// A list of active contexts for the session. A context can be set when an intent
// is fulfilled or by calling the PostContent , PostText , or PutSession
// operation. You can use a context to control the intents that can follow up an
// intent, or to modify the operation of your application.
ActiveContexts []types.ActiveContext
// Describes the current state of the bot.
DialogAction *types.DialogAction
// An array of information about the intents used in the session. The array can
// contain a maximum of three summaries. If more than three intents are used in the
// session, the recentIntentSummaryView operation contains information about the
// last three intents used. If you set the checkpointLabelFilter parameter in the
// request, the array contains only the intents with the specified label.
RecentIntentSummaryView []types.IntentSummary
// Map of key/value pairs representing the session-specific context information.
// It contains application information passed between Amazon Lex and a client
// application.
SessionAttributes map[string]string
// A unique identifier for the session.
SessionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSession",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
)
// Sends user input (text or speech) to Amazon Lex. Clients use this API to send
// text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the user
// input using the machine learning model that it built for the bot. The
// PostContent operation supports audio input at 8kHz and 16kHz. You can use 8kHz
// audio to achieve higher speech recognition accuracy in telephone audio
// applications. In response, Amazon Lex returns the next message to convey to the
// user. Consider the following example messages:
// - For a user input "I would like a pizza," Amazon Lex might return a response
// with a message eliciting slot data (for example, PizzaSize ): "What size pizza
// would you like?".
// - After the user provides all of the pizza order information, Amazon Lex
// might return a response with a message to get user confirmation: "Order the
// pizza?".
// - After the user replies "Yes" to the confirmation prompt, Amazon Lex might
// return a conclusion statement: "Thank you, your cheese pizza has been ordered.".
//
// Not all Amazon Lex messages require a response from the user. For example,
// conclusion statements do not require a response. Some messages require only a
// yes or no response. In addition to the message , Amazon Lex provides additional
// context about the message in the response that you can use to enhance client
// behavior, such as displaying the appropriate client user interface. Consider the
// following examples:
// - If the message is to elicit slot data, Amazon Lex returns the following
// context information:
// - x-amz-lex-dialog-state header set to ElicitSlot
// - x-amz-lex-intent-name header set to the intent name in the current context
// - x-amz-lex-slot-to-elicit header set to the slot name for which the message
// is eliciting information
// - x-amz-lex-slots header set to a map of slots configured for the intent with
// their current values
// - If the message is a confirmation prompt, the x-amz-lex-dialog-state header
// is set to Confirmation and the x-amz-lex-slot-to-elicit header is omitted.
// - If the message is a clarification prompt configured for the intent,
// indicating that the user intent is not understood, the x-amz-dialog-state
// header is set to ElicitIntent and the x-amz-slot-to-elicit header is omitted.
//
// In addition, Amazon Lex also returns your application-specific sessionAttributes
// . For more information, see Managing Conversation Context (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html)
// .
func (c *Client) PostContent(ctx context.Context, params *PostContentInput, optFns ...func(*Options)) (*PostContentOutput, error) {
if params == nil {
params = &PostContentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PostContent", params, optFns, c.addOperationPostContentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PostContentOutput)
out.ResultMetadata = metadata
return out, nil
}
type PostContentInput struct {
// Alias of the Amazon Lex bot.
//
// This member is required.
BotAlias *string
// Name of the Amazon Lex bot.
//
// This member is required.
BotName *string
// You pass this value as the Content-Type HTTP header. Indicates the audio format
// or text. The header value must start with one of the following prefixes:
// - PCM format, audio data must be in little-endian byte order.
// - audio/l16; rate=16000; channels=1
// - audio/x-l16; sample-rate=16000; channel-count=1
// - audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1;
// is-big-endian=false
// - Opus format
// - audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000;
// frame-size-milliseconds=4
// - Text format
// - text/plain; charset=utf-8
//
// This member is required.
ContentType *string
// User input in PCM or Opus audio format or text format as described in the
// Content-Type HTTP header. You can stream audio data to Amazon Lex or you can
// create a local buffer that captures all of the audio data before sending. In
// general, you get better performance if you stream audio data rather than
// buffering the data locally.
//
// This member is required.
InputStream io.Reader
// The ID of the client application user. Amazon Lex uses this to identify a
// user's conversation with your bot. At runtime, each request must contain the
// userID field. To decide the user ID to use for your application, consider the
// following factors.
// - The userID field must not contain any personally identifiable information of
// the user, for example, name, personal identification numbers, or other end user
// personal information.
// - If you want a user to start a conversation on one device and continue on
// another device, use a user-specific identifier.
// - If you want the same user to be able to have two independent conversations
// on two different devices, choose a device-specific identifier.
// - A user can't have two independent conversations with two different versions
// of the same bot. For example, a user can't have a conversation with the PROD and
// BETA versions of the same bot. If you anticipate that a user will need to have
// conversation with two different versions, for example, while testing, include
// the bot alias in the user ID to separate the two conversations.
//
// This member is required.
UserId *string
// You pass this value as the Accept HTTP header. The message Amazon Lex returns
// in the response can be either text or speech based on the Accept HTTP header
// value in the request.
// - If the value is text/plain; charset=utf-8 , Amazon Lex returns text in the
// response.
// - If the value begins with audio/ , Amazon Lex returns speech in the response.
// Amazon Lex uses Amazon Polly to generate the speech (using the configuration you
// specified in the Accept header). For example, if you specify audio/mpeg as the
// value, Amazon Lex returns speech in the MPEG format.
// - If the value is audio/pcm , the speech returned is audio/pcm in 16-bit,
// little endian format.
// - The following are the accepted values:
// - audio/mpeg
// - audio/ogg
// - audio/pcm
// - text/plain; charset=utf-8
// - audio/* (defaults to mpeg)
Accept *string
// A list of contexts active for the request. A context can be activated when a
// previous intent is fulfilled, or by including the context in the request, If you
// don't specify a list of contexts, Amazon Lex will use the current list of
// contexts for the session. If you specify an empty list, all contexts for the
// session are cleared.
//
// This value conforms to the media type: application/json
ActiveContexts *string
// You pass this value as the x-amz-lex-request-attributes HTTP header.
// Request-specific information passed between Amazon Lex and a client application.
// The value must be a JSON serialized and base64 encoded map with string keys and
// values. The total size of the requestAttributes and sessionAttributes headers
// is limited to 12 KB. The namespace x-amz-lex: is reserved for special
// attributes. Don't create any request attributes with the prefix x-amz-lex: . For
// more information, see Setting Request Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs)
// .
//
// This value conforms to the media type: application/json
RequestAttributes *string
// You pass this value as the x-amz-lex-session-attributes HTTP header.
// Application-specific information passed between Amazon Lex and a client
// application. The value must be a JSON serialized and base64 encoded map with
// string keys and values. The total size of the sessionAttributes and
// requestAttributes headers is limited to 12 KB. For more information, see
// Setting Session Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs)
// .
//
// This value conforms to the media type: application/json
SessionAttributes *string
noSmithyDocumentSerde
}
type PostContentOutput struct {
// A list of active contexts for the session. A context can be set when an intent
// is fulfilled or by calling the PostContent , PostText , or PutSession
// operation. You can use a context to control the intents that can follow up an
// intent, or to modify the operation of your application.
//
// This value conforms to the media type: application/json
ActiveContexts *string
// One to four alternative intents that may be applicable to the user's intent.
// Each alternative includes a score that indicates how confident Amazon Lex is
// that the intent matches the user's intent. The intents are sorted by the
// confidence score.
//
// This value conforms to the media type: application/json
AlternativeIntents *string
// The prompt (or statement) to convey to the user. This is based on the bot
// configuration and context. For example, if Amazon Lex did not understand the
// user intent, it sends the clarificationPrompt configured for the bot. If the
// intent requires confirmation before taking the fulfillment action, it sends the
// confirmationPrompt . Another example: Suppose that the Lambda function
// successfully fulfilled the intent, and sent a message to convey to the user.
// Then Amazon Lex sends that message in the response.
AudioStream io.ReadCloser
// The version of the bot that responded to the conversation. You can use this
// information to help determine if one version of a bot is performing better than
// another version.
BotVersion *string
// Content type as specified in the Accept HTTP header in the request.
ContentType *string
// Identifies the current state of the user interaction. Amazon Lex returns one of
// the following values as dialogState . The client can optionally use this
// information to customize the user interface.
// - ElicitIntent - Amazon Lex wants to elicit the user's intent. Consider the
// following examples: For example, a user might utter an intent ("I want to order
// a pizza"). If Amazon Lex cannot infer the user intent from this utterance, it
// will return this dialog state.
// - ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response. For
// example, Amazon Lex wants user confirmation before fulfilling an intent. Instead
// of a simple "yes" or "no" response, a user might respond with additional
// information. For example, "yes, but make it a thick crust pizza" or "no, I want
// to order a drink." Amazon Lex can process such additional information (in these
// examples, update the crust type slot or change the intent from OrderPizza to
// OrderDrink).
// - ElicitSlot - Amazon Lex is expecting the value of a slot for the current
// intent. For example, suppose that in the response Amazon Lex sends this message:
// "What size pizza would you like?". A user might reply with the slot value (e.g.,
// "medium"). The user might also provide additional information in the response
// (e.g., "medium thick crust pizza"). Amazon Lex can process such additional
// information appropriately.
// - Fulfilled - Conveys that the Lambda function has successfully fulfilled the
// intent.
// - ReadyForFulfillment - Conveys that the client has to fulfill the request.
// - Failed - Conveys that the conversation with the user failed. This can happen
// for various reasons, including that the user does not provide an appropriate
// response to prompts from the service (you can configure how many times Amazon
// Lex can prompt a user for specific information), or if the Lambda function fails
// to fulfill the intent.
DialogState types.DialogState
// The text used to process the request. If the input was an audio stream, the
// encodedInputTranscript field contains the text extracted from the audio stream.
// This is the text that is actually processed to recognize intents and slot
// values. You can use this information to determine if Amazon Lex is correctly
// processing the audio that you send. The encodedInputTranscript field is base-64
// encoded. You must decode the field before you can use the value.
EncodedInputTranscript *string
// The message to convey to the user. The message can come from the bot's
// configuration or from a Lambda function. If the intent is not configured with a
// Lambda function, or if the Lambda function returned Delegate as the
// dialogAction.type in its response, Amazon Lex decides on the next course of
// action and selects an appropriate message from the bot's configuration based on
// the current interaction context. For example, if Amazon Lex isn't able to
// understand user input, it uses a clarification prompt message. When you create
// an intent you can assign messages to groups. When messages are assigned to
// groups Amazon Lex returns one message from each group in the response. The
// message field is an escaped JSON string containing the messages. For more
// information about the structure of the JSON string returned, see
// msg-prompts-formats . If the Lambda function returns a message, Amazon Lex
// passes it to the client in its response. The encodedMessage field is base-64
// encoded. You must decode the field before you can use the value.
EncodedMessage *string
// The text used to process the request. You can use this field only in the de-DE,
// en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In
// all other locales, the inputTranscript field is null. You should use the
// encodedInputTranscript field instead. If the input was an audio stream, the
// inputTranscript field contains the text extracted from the audio stream. This is
// the text that is actually processed to recognize intents and slot values. You
// can use this information to determine if Amazon Lex is correctly processing the
// audio that you send.
//
// Deprecated: The inputTranscript field is deprecated, use the
// encodedInputTranscript field instead. The inputTranscript field is available
// only in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR and
// it-IT locales.
InputTranscript *string
// Current user intent that Amazon Lex is aware of.
IntentName *string
// You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419, es-ES,
// es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the message field
// is null. You should use the encodedMessage field instead. The message to convey
// to the user. The message can come from the bot's configuration or from a Lambda
// function. If the intent is not configured with a Lambda function, or if the
// Lambda function returned Delegate as the dialogAction.type in its response,
// Amazon Lex decides on the next course of action and selects an appropriate
// message from the bot's configuration based on the current interaction context.
// For example, if Amazon Lex isn't able to understand user input, it uses a
// clarification prompt message. When you create an intent you can assign messages
// to groups. When messages are assigned to groups Amazon Lex returns one message
// from each group in the response. The message field is an escaped JSON string
// containing the messages. For more information about the structure of the JSON
// string returned, see msg-prompts-formats . If the Lambda function returns a
// message, Amazon Lex passes it to the client in its response.
//
// Deprecated: The message field is deprecated, use the encodedMessage field
// instead. The message field is available only in the de-DE, en-AU, en-GB, en-US,
// es-419, es-ES, es-US, fr-CA, fr-FR and it-IT locales.
Message *string
// The format of the response message. One of the following values:
// - PlainText - The message contains plain UTF-8 text.
// - CustomPayload - The message is a custom format for the client.
// - SSML - The message contains text formatted for voice output.
// - Composite - The message contains an escaped JSON object containing one or
// more messages from the groups that messages were assigned to when the intent was
// created.
MessageFormat types.MessageFormatType
// Provides a score that indicates how confident Amazon Lex is that the returned
// intent is the one that matches the user's intent. The score is between 0.0 and
// 1.0. The score is a relative score, not an absolute score. The score may change
// based on improvements to Amazon Lex.
//
// This value conforms to the media type: application/json
NluIntentConfidence *string
// The sentiment expressed in an utterance. When the bot is configured to send
// utterances to Amazon Comprehend for sentiment analysis, this field contains the
// result of the analysis.
SentimentResponse *string
// Map of key/value pairs representing the session-specific context information.
//
// This value conforms to the media type: application/json
SessionAttributes *string
// The unique identifier for the session.
SessionId *string
// If the dialogState value is ElicitSlot , returns the name of the slot for which
// Amazon Lex is eliciting a value.
SlotToElicit *string
// Map of zero or more intent slots (name/value pairs) Amazon Lex detected from
// the user input during the conversation. The field is base-64 encoded. Amazon Lex
// creates a resolution list containing likely values for a slot. The value that it
// returns is determined by the valueSelectionStrategy selected when the slot type
// was created or updated. If valueSelectionStrategy is set to ORIGINAL_VALUE , the
// value provided by the user is returned, if the user value is similar to the slot
// values. If valueSelectionStrategy is set to TOP_RESOLUTION Amazon Lex returns
// the first value in the resolution list or, if there is no resolution list, null.
// If you don't specify a valueSelectionStrategy , the default is ORIGINAL_VALUE .
//
// This value conforms to the media type: application/json
Slots *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPostContentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPostContent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPostContent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddUnsignedPayloadMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPostContentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPostContent(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPostContent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PostContent",
}
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sends user input to Amazon Lex. Client applications can use this API to send
// requests to Amazon Lex at runtime. Amazon Lex then interprets the user input
// using the machine learning model it built for the bot. In response, Amazon Lex
// returns the next message to convey to the user an optional responseCard to
// display. Consider the following example messages:
// - For a user input "I would like a pizza", Amazon Lex might return a response
// with a message eliciting slot data (for example, PizzaSize): "What size pizza
// would you like?"
// - After the user provides all of the pizza order information, Amazon Lex
// might return a response with a message to obtain user confirmation "Proceed with
// the pizza order?".
// - After the user replies to a confirmation prompt with a "yes", Amazon Lex
// might return a conclusion statement: "Thank you, your cheese pizza has been
// ordered.".
//
// Not all Amazon Lex messages require a user response. For example, a conclusion
// statement does not require a response. Some messages require only a "yes" or
// "no" user response. In addition to the message , Amazon Lex provides additional
// context about the message in the response that you might use to enhance client
// behavior, for example, to display the appropriate client user interface. These
// are the slotToElicit , dialogState , intentName , and slots fields in the
// response. Consider the following examples:
// - If the message is to elicit slot data, Amazon Lex returns the following
// context information:
// - dialogState set to ElicitSlot
// - intentName set to the intent name in the current context
// - slotToElicit set to the slot name for which the message is eliciting
// information
// - slots set to a map of slots, configured for the intent, with currently known
// values
// - If the message is a confirmation prompt, the dialogState is set to
// ConfirmIntent and SlotToElicit is set to null.
// - If the message is a clarification prompt (configured for the intent) that
// indicates that user intent is not understood, the dialogState is set to
// ElicitIntent and slotToElicit is set to null.
//
// In addition, Amazon Lex also returns your application-specific sessionAttributes
// . For more information, see Managing Conversation Context (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html)
// .
func (c *Client) PostText(ctx context.Context, params *PostTextInput, optFns ...func(*Options)) (*PostTextOutput, error) {
if params == nil {
params = &PostTextInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PostText", params, optFns, c.addOperationPostTextMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PostTextOutput)
out.ResultMetadata = metadata
return out, nil
}
type PostTextInput struct {
// The alias of the Amazon Lex bot.
//
// This member is required.
BotAlias *string
// The name of the Amazon Lex bot.
//
// This member is required.
BotName *string
// The text that the user entered (Amazon Lex interprets this text).
//
// This member is required.
InputText *string
// The ID of the client application user. Amazon Lex uses this to identify a
// user's conversation with your bot. At runtime, each request must contain the
// userID field. To decide the user ID to use for your application, consider the
// following factors.
// - The userID field must not contain any personally identifiable information of
// the user, for example, name, personal identification numbers, or other end user
// personal information.
// - If you want a user to start a conversation on one device and continue on
// another device, use a user-specific identifier.
// - If you want the same user to be able to have two independent conversations
// on two different devices, choose a device-specific identifier.
// - A user can't have two independent conversations with two different versions
// of the same bot. For example, a user can't have a conversation with the PROD and
// BETA versions of the same bot. If you anticipate that a user will need to have
// conversation with two different versions, for example, while testing, include
// the bot alias in the user ID to separate the two conversations.
//
// This member is required.
UserId *string
// A list of contexts active for the request. A context can be activated when a
// previous intent is fulfilled, or by including the context in the request, If you
// don't specify a list of contexts, Amazon Lex will use the current list of
// contexts for the session. If you specify an empty list, all contexts for the
// session are cleared.
ActiveContexts []types.ActiveContext
// Request-specific information passed between Amazon Lex and a client
// application. The namespace x-amz-lex: is reserved for special attributes. Don't
// create any request attributes with the prefix x-amz-lex: . For more information,
// see Setting Request Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs)
// .
RequestAttributes map[string]string
// Application-specific information passed between Amazon Lex and a client
// application. For more information, see Setting Session Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs)
// .
SessionAttributes map[string]string
noSmithyDocumentSerde
}
type PostTextOutput struct {
// A list of active contexts for the session. A context can be set when an intent
// is fulfilled or by calling the PostContent , PostText , or PutSession
// operation. You can use a context to control the intents that can follow up an
// intent, or to modify the operation of your application.
ActiveContexts []types.ActiveContext
// One to four alternative intents that may be applicable to the user's intent.
// Each alternative includes a score that indicates how confident Amazon Lex is
// that the intent matches the user's intent. The intents are sorted by the
// confidence score.
AlternativeIntents []types.PredictedIntent
// The version of the bot that responded to the conversation. You can use this
// information to help determine if one version of a bot is performing better than
// another version.
BotVersion *string
// Identifies the current state of the user interaction. Amazon Lex returns one of
// the following values as dialogState . The client can optionally use this
// information to customize the user interface.
// - ElicitIntent - Amazon Lex wants to elicit user intent. For example, a user
// might utter an intent ("I want to order a pizza"). If Amazon Lex cannot infer
// the user intent from this utterance, it will return this dialogState.
// - ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response. For
// example, Amazon Lex wants user confirmation before fulfilling an intent. Instead
// of a simple "yes" or "no," a user might respond with additional information. For
// example, "yes, but make it thick crust pizza" or "no, I want to order a drink".
// Amazon Lex can process such additional information (in these examples, update
// the crust type slot value, or change intent from OrderPizza to OrderDrink).
// - ElicitSlot - Amazon Lex is expecting a slot value for the current intent.
// For example, suppose that in the response Amazon Lex sends this message: "What
// size pizza would you like?". A user might reply with the slot value (e.g.,
// "medium"). The user might also provide additional information in the response
// (e.g., "medium thick crust pizza"). Amazon Lex can process such additional
// information appropriately.
// - Fulfilled - Conveys that the Lambda function configured for the intent has
// successfully fulfilled the intent.
// - ReadyForFulfillment - Conveys that the client has to fulfill the intent.
// - Failed - Conveys that the conversation with the user failed. This can happen
// for various reasons including that the user did not provide an appropriate
// response to prompts from the service (you can configure how many times Amazon
// Lex can prompt a user for specific information), or the Lambda function failed
// to fulfill the intent.
DialogState types.DialogState
// The current user intent that Amazon Lex is aware of.
IntentName *string
// The message to convey to the user. The message can come from the bot's
// configuration or from a Lambda function. If the intent is not configured with a
// Lambda function, or if the Lambda function returned Delegate as the
// dialogAction.type its response, Amazon Lex decides on the next course of action
// and selects an appropriate message from the bot's configuration based on the
// current interaction context. For example, if Amazon Lex isn't able to understand
// user input, it uses a clarification prompt message. When you create an intent
// you can assign messages to groups. When messages are assigned to groups Amazon
// Lex returns one message from each group in the response. The message field is an
// escaped JSON string containing the messages. For more information about the
// structure of the JSON string returned, see msg-prompts-formats . If the Lambda
// function returns a message, Amazon Lex passes it to the client in its response.
Message *string
// The format of the response message. One of the following values:
// - PlainText - The message contains plain UTF-8 text.
// - CustomPayload - The message is a custom format defined by the Lambda
// function.
// - SSML - The message contains text formatted for voice output.
// - Composite - The message contains an escaped JSON object containing one or
// more messages from the groups that messages were assigned to when the intent was
// created.
MessageFormat types.MessageFormatType
// Provides a score that indicates how confident Amazon Lex is that the returned
// intent is the one that matches the user's intent. The score is between 0.0 and
// 1.0. For more information, see Confidence Scores (https://docs.aws.amazon.com/lex/latest/dg/confidence-scores.html)
// . The score is a relative score, not an absolute score. The score may change
// based on improvements to Amazon Lex.
NluIntentConfidence *types.IntentConfidence
// Represents the options that the user has to respond to the current prompt.
// Response Card can come from the bot configuration (in the Amazon Lex console,
// choose the settings button next to a slot) or from a code hook (Lambda
// function).
ResponseCard *types.ResponseCard
// The sentiment expressed in and utterance. When the bot is configured to send
// utterances to Amazon Comprehend for sentiment analysis, this field contains the
// result of the analysis.
SentimentResponse *types.SentimentResponse
// A map of key-value pairs representing the session-specific context information.
SessionAttributes map[string]string
// A unique identifier for the session.
SessionId *string
// If the dialogState value is ElicitSlot , returns the name of the slot for which
// Amazon Lex is eliciting a value.
SlotToElicit *string
// The intent slots that Amazon Lex detected from the user input in the
// conversation. Amazon Lex creates a resolution list containing likely values for
// a slot. The value that it returns is determined by the valueSelectionStrategy
// selected when the slot type was created or updated. If valueSelectionStrategy
// is set to ORIGINAL_VALUE , the value provided by the user is returned, if the
// user value is similar to the slot values. If valueSelectionStrategy is set to
// TOP_RESOLUTION Amazon Lex returns the first value in the resolution list or, if
// there is no resolution list, null. If you don't specify a valueSelectionStrategy
// , the default is ORIGINAL_VALUE .
Slots map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPostTextMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPostText{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPostText{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPostTextValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPostText(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPostText(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PostText",
}
}
| 320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.