def METHOD_NAME(message: Dict[str, str]) -> str:
    """
    Extract the plain text that was used for signing to compare signatures.
    This is done based on the message type. See this URL for more information:
    https://docs.aws.amazon.com/sns/latest/dg/sns-example-code-endpoint-java-servlet.html
    :param message: SNS Message
    :return: Plain text for creating the signature on the client side
    """
    keys: Sequence[str] = ()
    m_type = message.get('Type')
    if m_type in (
        SnsNotificationType.SubscriptionConfirmation.value,
        SnsNotificationType.UnsubscribeConfirmation.value,
    ):
        keys = (
            'Message',
            'MessageId',
            'SubscribeURL',
            'Timestamp',
            'Token',
            'TopicArn',
            'Type',
        )
    elif m_type == SnsNotificationType.Notification.value:
        if message.get('Subject'):
            keys = (
                'Message',
                'MessageId',
                'Subject',
                'Timestamp',
                'TopicArn',
                'Type',
            )
        else:
            keys = (
                'Message',
                'MessageId',
                'Timestamp',
                'TopicArn',
                'Type',
            )
    pairs = [f'{key}\n{message.get(key)}' for key in keys]
    return '\n'.join(pairs) + '\n'