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, c.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	noSmithyDocumentSerde
70}
71
72type UpdateBotOutput struct {
73
74	// The unique identifier of the bot that was updated.
75	BotId *string
76
77	// The name of the bot after the update.
78	BotName *string
79
80	// Shows the current status of the bot. The bot is first in the Creating status.
81	// Once the bot is read for use, it changes to the Available status. After the bot
82	// is created, you can use the DRAFT version of the bot.
83	BotStatus types.BotStatus
84
85	// A timestamp of the date and time that the bot was created.
86	CreationDateTime *time.Time
87
88	// The data privacy settings for the bot after the update.
89	DataPrivacy *types.DataPrivacy
90
91	// The description of the bot after the update.
92	Description *string
93
94	// The session timeout, in seconds, for the bot after the update.
95	IdleSessionTTLInSeconds *int32
96
97	// A timestamp of the date and time that the bot was last updated.
98	LastUpdatedDateTime *time.Time
99
100	// The Amazon Resource Name (ARN) of the IAM role used by the bot after the update.
101	RoleArn *string
102
103	// Metadata pertaining to the operation's result.
104	ResultMetadata middleware.Metadata
105
106	noSmithyDocumentSerde
107}
108
109func (c *Client) addOperationUpdateBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
110	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBot{}, middleware.After)
111	if err != nil {
112		return err
113	}
114	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBot{}, middleware.After)
115	if err != nil {
116		return err
117	}
118	if err = addSetLoggerMiddleware(stack, options); err != nil {
119		return err
120	}
121	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
122		return err
123	}
124	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
125		return err
126	}
127	if err = addResolveEndpointMiddleware(stack, options); err != nil {
128		return err
129	}
130	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
131		return err
132	}
133	if err = addRetryMiddlewares(stack, options); err != nil {
134		return err
135	}
136	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
137		return err
138	}
139	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
140		return err
141	}
142	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
143		return err
144	}
145	if err = addClientUserAgent(stack); err != nil {
146		return err
147	}
148	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
149		return err
150	}
151	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
152		return err
153	}
154	if err = addOpUpdateBotValidationMiddleware(stack); err != nil {
155		return err
156	}
157	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBot(options.Region), middleware.Before); err != nil {
158		return err
159	}
160	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
161		return err
162	}
163	if err = addResponseErrorMiddleware(stack); err != nil {
164		return err
165	}
166	if err = addRequestResponseLogging(stack, options); err != nil {
167		return err
168	}
169	return nil
170}
171
172func newServiceMetadataMiddleware_opUpdateBot(region string) *awsmiddleware.RegisterServiceMetadata {
173	return &awsmiddleware.RegisterServiceMetadata{
174		Region:        region,
175		ServiceID:     ServiceID,
176		SigningName:   "lex",
177		OperationName: "UpdateBot",
178	}
179}
180