deleteSshPublicKey method

Future<void> deleteSshPublicKey({
  1. required String serverId,
  2. required String sshPublicKeyId,
  3. required String userName,
})

Deletes a user's Secure Shell (SSH) public key.

No response is returned from this operation.

May throw ServiceUnavailableException. May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter serverId : A system-assigned unique identifier for a file transfer protocol-enabled server instance that has the user assigned to it.

Parameter sshPublicKeyId : A unique identifier used to reference your user's specific SSH key.

Parameter userName : A unique string that identifies a user whose public key is being deleted.

Implementation

Future<void> deleteSshPublicKey({
  required String serverId,
  required String sshPublicKeyId,
  required String userName,
}) async {
  ArgumentError.checkNotNull(serverId, 'serverId');
  _s.validateStringLength(
    'serverId',
    serverId,
    19,
    19,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sshPublicKeyId, 'sshPublicKeyId');
  _s.validateStringLength(
    'sshPublicKeyId',
    sshPublicKeyId,
    21,
    21,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    3,
    100,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.DeleteSshPublicKey'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServerId': serverId,
      'SshPublicKeyId': sshPublicKeyId,
      'UserName': userName,
    },
  );
}