/
api_op_UpdateUserPool.go
189 lines (163 loc) · 6.16 KB
/
api_op_UpdateUserPool.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// Code generated by smithy-go-codegen DO NOT EDIT.
package cognitoidentityprovider
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/cognitoidentityprovider/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified user pool with the specified attributes. You can get a
// list of the current user pool settings using DescribeUserPool
// (https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DescribeUserPool.html).
// If you don't provide a value for an attribute, it will be set to the default
// value.
func (c *Client) UpdateUserPool(ctx context.Context, params *UpdateUserPoolInput, optFns ...func(*Options)) (*UpdateUserPoolOutput, error) {
if params == nil {
params = &UpdateUserPoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateUserPool", params, optFns, addOperationUpdateUserPoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateUserPoolOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the request to update the user pool.
type UpdateUserPoolInput struct {
// The user pool ID for the user pool you want to update.
//
// This member is required.
UserPoolId *string
// Use this setting to define which verified available method a user can use to
// recover their password when they call ForgotPassword. It allows you to define a
// preferred method when a user has more than one method available. With this
// setting, SMS does not qualify for a valid password recovery mechanism if the
// user also has SMS MFA enabled. In the absence of this setting, Cognito uses the
// legacy behavior to determine the recovery method where SMS is preferred over
// email.
AccountRecoverySetting *types.AccountRecoverySettingType
// The configuration for AdminCreateUser requests.
AdminCreateUserConfig *types.AdminCreateUserConfigType
// The attributes that are automatically verified when the Amazon Cognito service
// makes a request to update user pools.
AutoVerifiedAttributes []types.VerifiedAttributeType
// Device configuration.
DeviceConfiguration *types.DeviceConfigurationType
// Email configuration.
EmailConfiguration *types.EmailConfigurationType
// The contents of the email verification message.
EmailVerificationMessage *string
// The subject of the email verification message.
EmailVerificationSubject *string
// The AWS Lambda configuration information from the request to update the user
// pool.
LambdaConfig *types.LambdaConfigType
// Can be one of the following values:
//
// * OFF - MFA tokens are not required and
// cannot be specified during user registration.
//
// * ON - MFA tokens are required
// for all user registrations. You can only specify required when you are initially
// creating a user pool.
//
// * OPTIONAL - Users have the option when registering to
// create an MFA token.
MfaConfiguration types.UserPoolMfaType
// A container with the policies you wish to update in a user pool.
Policies *types.UserPoolPolicyType
// The contents of the SMS authentication message.
SmsAuthenticationMessage *string
// SMS configuration.
SmsConfiguration *types.SmsConfigurationType
// A container with information about the SMS verification message.
SmsVerificationMessage *string
// Used to enable advanced security risk detection. Set the key
// AdvancedSecurityMode to the value "AUDIT".
UserPoolAddOns *types.UserPoolAddOnsType
// The tag keys and values to assign to the user pool. A tag is a label that you
// can use to categorize and manage user pools in different ways, such as by
// purpose, owner, environment, or other criteria.
UserPoolTags map[string]string
// The template for verification messages.
VerificationMessageTemplate *types.VerificationMessageTemplateType
}
// Represents the response from the server when you make a request to update the
// user pool.
type UpdateUserPoolOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationUpdateUserPoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateUserPool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateUserPool{}, 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 = addOpUpdateUserPoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUserPool(options.Region), middleware.Before); 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_opUpdateUserPool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "cognito-idp",
OperationName: "UpdateUserPool",
}
}