createLoginProfile method

Future<CreateLoginProfileResponse> createLoginProfile({
  1. required String password,
  2. required String userName,
  3. bool? passwordResetRequired,
})

Creates a password for the specified user, giving the user the ability to access AWS services through the AWS Management Console. For more information about managing passwords, see Managing Passwords in the IAM User Guide.

May throw EntityAlreadyExistsException. May throw NoSuchEntityException. May throw PasswordPolicyViolationException. May throw LimitExceededException. May throw ServiceFailureException.

Parameter password : The new password for the user.

The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020) through the end of the ASCII character range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), and carriage return (\u000D) characters. Any of these characters are valid in a password. However, many tools, such as the AWS Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.

Parameter userName : The name of the IAM user to create a password for. The user must already exist.

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 passwordResetRequired : Specifies whether the user is required to set a new password on next sign-in.

Implementation

Future<CreateLoginProfileResponse> createLoginProfile({
  required String password,
  required String userName,
  bool? passwordResetRequired,
}) async {
  ArgumentError.checkNotNull(password, 'password');
  _s.validateStringLength(
    'password',
    password,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    64,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['Password'] = password;
  $request['UserName'] = userName;
  passwordResetRequired
      ?.also((arg) => $request['PasswordResetRequired'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateLoginProfile',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateLoginProfileRequest'],
    shapes: shapes,
    resultWrapper: 'CreateLoginProfileResult',
  );
  return CreateLoginProfileResponse.fromXml($result);
}