resetServiceSpecificCredential method

Future<ResetServiceSpecificCredentialResponse> resetServiceSpecificCredential({
  1. required String serviceSpecificCredentialId,
  2. String? userName,
})

Resets the password for a service-specific credential. The new password is AWS generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.

May throw NoSuchEntityException.

Parameter serviceSpecificCredentialId : The unique identifier of the service-specific credential.

This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit.

Parameter userName : The name of the IAM user associated with the service-specific credential. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.

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<ResetServiceSpecificCredentialResponse>
    resetServiceSpecificCredential({
  required String serviceSpecificCredentialId,
  String? userName,
}) async {
  ArgumentError.checkNotNull(
      serviceSpecificCredentialId, 'serviceSpecificCredentialId');
  _s.validateStringLength(
    'serviceSpecificCredentialId',
    serviceSpecificCredentialId,
    20,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'userName',
    userName,
    1,
    64,
  );
  final $request = <String, dynamic>{};
  $request['ServiceSpecificCredentialId'] = serviceSpecificCredentialId;
  userName?.also((arg) => $request['UserName'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ResetServiceSpecificCredential',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ResetServiceSpecificCredentialRequest'],
    shapes: shapes,
    resultWrapper: 'ResetServiceSpecificCredentialResult',
  );
  return ResetServiceSpecificCredentialResponse.fromXml($result);
}