Class S3EventNotification

java.lang.Object
software.amazon.awssdk.eventnotifications.s3.model.S3EventNotification

public class S3EventNotification extends Object
A helper class that represents a strongly typed S3 Event Notification item sent to SQS, SNS, or Lambda. For more information about Amazon S3 Event Notifications, visit the S3 User Guide. This class can be used to parse notification messages in the json format or to serialize a S3EventNotification instance to json.
  • Constructor Details

  • Method Details

    • getRecords

      public List<S3EventNotificationRecord> getRecords()
    • fromJson

      public static S3EventNotification fromJson(String json)
      Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.
      Parameters:
      json - the notification message in json format
      Returns:
      an instance of notification message S3EventNotification
    • fromJson

      public static S3EventNotification fromJson(byte[] json)
      Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.
      Parameters:
      json - the notification message in json format
      Returns:
      an instance of notification message S3EventNotification
    • fromJson

      public S3EventNotification fromJson(InputStream json)
      Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.
      Parameters:
      json - the notification message in json format
      Returns:
      an instance of notification message S3EventNotification
    • toJson

      public String toJson()
      Serialize this instance to json format. GlacierEventData, ReplicationEventData, IntelligentTieringEventData and LifecycleEventData keys will be excluded from the json if null. Any other null fields of the object will be serialized as json null.
      Returns:
      the json representation of this class.
    • toJsonPretty

      public String toJsonPretty()
      Serialize this instance to json format, with new line and correct indentation levels. GlacierEventData, ReplicationEventData, IntelligentTieringEventData and LifecycleEventData keys will be excluded from the json if null. Any other null fields of the object will be serialized as json null.
      Returns:
      the json representation of this class.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object