updateConfig method

Future<void> updateConfig({
  1. required String folderPath,
  2. required MailboxType type,
  3. int? maxMessages,
  4. int? retentionDays,
  5. int? retentionCount,
})

Update mailbox configuration

Implementation

Future<void> updateConfig({
  required String folderPath,
  required MailboxType type,
  int? maxMessages,
  int? retentionDays,
  int? retentionCount,
}) async {
  _logger.fine('Updating config for $folderPath');

  final address = MailboxAddress(
    ownerId: host.id,
    folderPath: folderPath,
    type: type,
  );

  final request = UpdateMailboxConfigRequest(
    address: address,
    maxMessages: maxMessages,
    retentionDays: retentionDays,
    retentionCount: retentionCount,
  );

  final response = await _sendRequest(request);
  if (!response.success) {
    throw MailboxManagementError(
      response.errorMessage ?? 'Failed to update config',
    );
  }

  _logger.info('Updated config for ${address.fullPath}');
}