1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package lexmodelsv2
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/lexmodelsv2/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Updates the configuration of an existing bot.
16func (c *Client) UpdateBot(ctx context.Context, params *UpdateBotInput, optFns ...func(*Options)) (*UpdateBotOutput, error) {
17	if params == nil {
18		params = &UpdateBotInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "UpdateBot", params, optFns, addOperationUpdateBotMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*UpdateBotOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type UpdateBotInput struct {
32
33	// The unique identifier of the bot to update. This identifier is returned by the
34	// CreateBot operation.
35	//
36	// This member is required.
37	BotId *string
38
39	// The new name of the bot. The name must be unique in the account that creates the
40	// bot.
41	//
42	// This member is required.
43	BotName *string
44
45	// Provides information on additional privacy protections Amazon Lex should use
46	// with the bot's data.
47	//
48	// This member is required.
49	DataPrivacy *types.DataPrivacy
50
51	// The time, in seconds, that Amazon Lex should keep information about a user's
52	// conversation with the bot. A user interaction remains active for the amount of
53	// time specified. If no conversation occurs during this time, the session expires
54	// and Amazon Lex deletes any data provided before the timeout. You can specify
55	// between 60 (1 minute) and 86,400 (24 hours) seconds.
56	//
57	// This member is required.
58	IdleSessionTTLInSeconds *int32
59
60	// The Amazon Resource Name (ARN) of an IAM role that has permissions to access the
61	// bot.
62	//
63	// This member is required.
64	RoleArn *string
65
66	// A description of the bot.
67	Description *string
68}
69
70type UpdateBotOutput struct {
71
72	// The unique identifier of the bot that was updated.
73	BotId *string
74
75	// The name of the bot after the update.
76	BotName *string
77
78	// Shows the current status of the bot. The bot is first in the Creating status.
79	// Once the bot is read for use, it changes to the Available status. After the bot
80	// is created, you can use the DRAFT version of the bot.
81	BotStatus types.BotStatus
82
83	// A timestamp of the date and time that the bot was created.
84	CreationDateTime *time.Time
85
86	// The data privacy settings for the bot after the update.
87	DataPrivacy *types.DataPrivacy
88
89	// The description of the bot after the update.
90	Description *string
91
92	// The session timeout, in seconds, for the bot after the update.
93	IdleSessionTTLInSeconds *int32
94
95	// A timestamp of the date and time that the bot was last updated.
96	LastUpdatedDateTime *time.Time
97
98	// The Amazon Resource Name (ARN) of the IAM role used by the bot after the update.
99	RoleArn *string
100
101	// Metadata pertaining to the operation's result.
102	ResultMetadata middleware.Metadata
103}
104
105func addOperationUpdateBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
106	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBot{}, middleware.After)
107	if err != nil {
108		return err
109	}
110	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBot{}, middleware.After)
111	if err != nil {
112		return err
113	}
114	if err = addSetLoggerMiddleware(stack, options); err != nil {
115		return err
116	}
117	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
118		return err
119	}
120	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
121		return err
122	}
123	if err = addResolveEndpointMiddleware(stack, options); err != nil {
124		return err
125	}
126	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
127		return err
128	}
129	if err = addRetryMiddlewares(stack, options); err != nil {
130		return err
131	}
132	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
133		return err
134	}
135	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
136		return err
137	}
138	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
139		return err
140	}
141	if err = addClientUserAgent(stack); err != nil {
142		return err
143	}
144	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
145		return err
146	}
147	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
148		return err
149	}
150	if err = addOpUpdateBotValidationMiddleware(stack); err != nil {
151		return err
152	}
153	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBot(options.Region), middleware.Before); err != nil {
154		return err
155	}
156	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
157		return err
158	}
159	if err = addResponseErrorMiddleware(stack); err != nil {
160		return err
161	}
162	if err = addRequestResponseLogging(stack, options); err != nil {
163		return err
164	}
165	return nil
166}
167
168func newServiceMetadataMiddleware_opUpdateBot(region string) *awsmiddleware.RegisterServiceMetadata {
169	return &awsmiddleware.RegisterServiceMetadata{
170		Region:        region,
171		ServiceID:     ServiceID,
172		SigningName:   "lex",
173		OperationName: "UpdateBot",
174	}
175}
176