updateRoleAlias method
Updates a role alias.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.
Parameter roleAlias
:
The role alias to update.
Parameter credentialDurationSeconds
:
The number of seconds the credential will be valid.
Parameter roleArn
:
The role ARN.
Implementation
Future<UpdateRoleAliasResponse> updateRoleAlias({
required String roleAlias,
int? credentialDurationSeconds,
String? roleArn,
}) async {
ArgumentError.checkNotNull(roleAlias, 'roleAlias');
_s.validateStringLength(
'roleAlias',
roleAlias,
1,
128,
isRequired: true,
);
_s.validateNumRange(
'credentialDurationSeconds',
credentialDurationSeconds,
900,
3600,
);
_s.validateStringLength(
'roleArn',
roleArn,
20,
2048,
);
final $payload = <String, dynamic>{
if (credentialDurationSeconds != null)
'credentialDurationSeconds': credentialDurationSeconds,
if (roleArn != null) 'roleArn': roleArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/role-aliases/${Uri.encodeComponent(roleAlias)}',
exceptionFnMap: _exceptionFns,
);
return UpdateRoleAliasResponse.fromJson(response);
}