public static SnsNotificationDto convertToNotificationDto()

in amazon-sns-trigger-server/src/main/java/jetbrains/buildServer/clouds/amazon/sns/trigger/utils/AwsSnsMessageDetailsHelper.java [62:82]


  public static SnsNotificationDto convertToNotificationDto(HttpServletRequest request, @NotNull Map<String, Object> payload) {
    String subscriptionArn = request.getHeader(AwsSnsTriggerConstants.AWS_SUBSCRIPTION_ARN_HEADER);
    String messageId = request.getHeader(AwsSnsTriggerConstants.AWS_MESSAGE_ID_HEADER);
    String topic = request.getHeader(AwsSnsTriggerConstants.AWS_TOPIC_ARN_HEADER);
    String subject = (String) payload.get(AwsSnsTriggerConstants.NOTIFICATION_SUBJECT_KEY);
    String message = (String) payload.get(AwsSnsTriggerConstants.NOTIFICATION_MESSAGE_KEY);
    Instant timestamp = Instant.parse((String) payload.get(AwsSnsTriggerConstants.NOTIFICATION_TIMESTAMP_KEY));
    String unsubscribeUrl = (String) payload.get(AwsSnsTriggerConstants.UNSUBSCRIBE_URL_KEY);
    Map<String, Object> attributes = (Map<String, Object>) payload.get(AwsSnsTriggerConstants.NOTIFICATION_ATTRIBUTES_KEY);

    return new SnsNotificationDto(
            messageId,
            subscriptionArn,
            topic,
            subject,
            message,
            timestamp,
            unsubscribeUrl,
            attributes
    );
  }