package at.procon.dip.ingestion.mail;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Default implementation of the generic provider metadata contract.
 */
public record GenericMailProviderEnvelope(
        MailProviderType providerType,
        String accountKey,
        String folderKey,
        String providerMessageKey,
        String providerThreadKey,
        Map<String, String> providerAttributes
) implements MailProviderEnvelope {

    public GenericMailProviderEnvelope {
        providerType = providerType == null ? MailProviderType.GENERIC : providerType;
        providerAttributes = providerAttributes == null ? Map.of() : Map.copyOf(new LinkedHashMap<>(providerAttributes));
    }
}
