updateServiceSpecificCredential method

Future<void> updateServiceSpecificCredential({
  1. required String serviceSpecificCredentialId,
  2. required StatusType status,
  3. String? userName,
})

Sets the status of a service-specific credential to Active or Inactive. Service-specific credentials that are inactive cannot be used for authentication to the service. This operation can be used to disable a user's service-specific credential as part of a credential rotation work flow.

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 status : The status to be assigned to the service-specific credential.

Parameter userName : The name of the IAM user associated with the service-specific credential. If you do not specify this value, 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<void> updateServiceSpecificCredential({
  required String serviceSpecificCredentialId,
  required StatusType status,
  String? userName,
}) async {
  ArgumentError.checkNotNull(
      serviceSpecificCredentialId, 'serviceSpecificCredentialId');
  _s.validateStringLength(
    'serviceSpecificCredentialId',
    serviceSpecificCredentialId,
    20,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(status, 'status');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    64,
  );
  final $request = <String, dynamic>{};
  $request['ServiceSpecificCredentialId'] = serviceSpecificCredentialId;
  $request['Status'] = status.toValue();
  userName?.also((arg) => $request['UserName'] = arg);
  await _protocol.send(
    $request,
    action: 'UpdateServiceSpecificCredential',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UpdateServiceSpecificCredentialRequest'],
    shapes: shapes,
  );
}