adminSetUserSettings method
Future<void>
adminSetUserSettings({
- required List<
MFAOptionType> mFAOptions, - required String userPoolId,
- required String username,
This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to configure TOTP software token MFA. To configure either type of MFA, use AdminSetUserMFAPreference instead.
May throw ResourceNotFoundException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw UserNotFoundException. May throw InternalErrorException.
Parameter mFAOptions
:
You can use this parameter only to set an SMS configuration that uses SMS
for delivery.
Parameter userPoolId
:
The ID of the user pool that contains the user that you are setting
options for.
Parameter username
:
The user name of the user that you are setting options for.
Implementation
Future<void> adminSetUserSettings({
required List<MFAOptionType> mFAOptions,
required String userPoolId,
required String username,
}) async {
ArgumentError.checkNotNull(mFAOptions, 'mFAOptions');
ArgumentError.checkNotNull(userPoolId, 'userPoolId');
_s.validateStringLength(
'userPoolId',
userPoolId,
1,
55,
isRequired: true,
);
ArgumentError.checkNotNull(username, 'username');
_s.validateStringLength(
'username',
username,
1,
128,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminSetUserSettings'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'MFAOptions': mFAOptions,
'UserPoolId': userPoolId,
'Username': username,
},
);
}