resyncMFADevice method
Synchronizes the specified MFA device with its IAM resource object on the AWS servers.
For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device in the IAM User Guide.
May throw InvalidAuthenticationCodeException. May throw NoSuchEntityException. May throw LimitExceededException. May throw ServiceFailureException.
Parameter authenticationCode1
:
An authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
Parameter authenticationCode2
:
A subsequent authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
Parameter serialNumber
:
Serial number that uniquely identifies the MFA device.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Parameter userName
:
The name of the user whose MFA device you want to resynchronize.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Implementation
Future<void> resyncMFADevice({
required String authenticationCode1,
required String authenticationCode2,
required String serialNumber,
required String userName,
}) async {
ArgumentError.checkNotNull(authenticationCode1, 'authenticationCode1');
_s.validateStringLength(
'authenticationCode1',
authenticationCode1,
6,
6,
isRequired: true,
);
ArgumentError.checkNotNull(authenticationCode2, 'authenticationCode2');
_s.validateStringLength(
'authenticationCode2',
authenticationCode2,
6,
6,
isRequired: true,
);
ArgumentError.checkNotNull(serialNumber, 'serialNumber');
_s.validateStringLength(
'serialNumber',
serialNumber,
9,
256,
isRequired: true,
);
ArgumentError.checkNotNull(userName, 'userName');
_s.validateStringLength(
'userName',
userName,
1,
128,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['AuthenticationCode1'] = authenticationCode1;
$request['AuthenticationCode2'] = authenticationCode2;
$request['SerialNumber'] = serialNumber;
$request['UserName'] = userName;
await _protocol.send(
$request,
action: 'ResyncMFADevice',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ResyncMFADeviceRequest'],
shapes: shapes,
);
}