Interface DeliveryPayload

All Known Subinterfaces:
MessageDelivery, MessageDeliveryPayload, ResourceCreatedDelivery, ResourceCreatedDeliveryPayload, ResourceDeletedDelivery, ResourceDeletedDeliveryPayload, ResourceUpdatedDelivery, ResourceUpdatedDeliveryPayload, SubscriptionDelivery
All Known Implementing Classes:
DeliveryPayloadImpl, MessageDeliveryPayloadImpl, ResourceCreatedDeliveryPayloadImpl, ResourceDeletedDeliveryPayloadImpl, ResourceUpdatedDeliveryPayloadImpl

public interface DeliveryPayload

All payloads for the PlatformFormat share these common fields.


Example to create a subtype instance using the builder pattern

     DeliveryPayload deliveryPayload = DeliveryPayload.messageBuilder()
             projectKey("{projectKey}")
             resource(resourceBuilder -> resourceBuilder)
             id("{id}")
             version(0.3)
             createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             sequenceNumber(0.3)
             resourceVersion(0.3)
             .build()
 
  • Method Details

    • getProjectKey

      @NotNull @NotNull String getProjectKey()

      key of the Project. Useful in message processing if the Destination receives events from multiple Projects.

      Returns:
      projectKey
    • getNotificationType

      @NotNull @NotNull String getNotificationType()

      Identifies the payload.

      Returns:
      notificationType
    • getResource

      @NotNull @Valid @NotNull @Valid Reference getResource()

      Reference to the resource that triggered the message.

      Returns:
      resource
    • getResourceUserProvidedIdentifiers

      @Valid @Valid UserProvidedIdentifiers getResourceUserProvidedIdentifiers()

      User-defined unique identifiers of the resource.

      Returns:
      resourceUserProvidedIdentifiers
    • setProjectKey

      void setProjectKey(String projectKey)

      key of the Project. Useful in message processing if the Destination receives events from multiple Projects.

      Parameters:
      projectKey - value to be set
    • setResource

      void setResource(Reference resource)

      Reference to the resource that triggered the message.

      Parameters:
      resource - value to be set
    • setResourceUserProvidedIdentifiers

      void setResourceUserProvidedIdentifiers(UserProvidedIdentifiers resourceUserProvidedIdentifiers)

      User-defined unique identifiers of the resource.

      Parameters:
      resourceUserProvidedIdentifiers - value to be set
    • deepCopy

      @Nullable static DeliveryPayload deepCopy(@Nullable DeliveryPayload template)
      factory method to create a deep copy of DeliveryPayload
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • messageBuilder

      static MessageDeliveryPayloadBuilder messageBuilder()
      builder for message subtype
      Returns:
      builder
    • resourceCreatedBuilder

      static ResourceCreatedDeliveryPayloadBuilder resourceCreatedBuilder()
      builder for resourceCreated subtype
      Returns:
      builder
    • resourceDeletedBuilder

      static ResourceDeletedDeliveryPayloadBuilder resourceDeletedBuilder()
      builder for resourceDeleted subtype
      Returns:
      builder
    • resourceUpdatedBuilder

      static ResourceUpdatedDeliveryPayloadBuilder resourceUpdatedBuilder()
      builder for resourceUpdated subtype
      Returns:
      builder
    • withDeliveryPayload

      default <T> T withDeliveryPayload(Function<DeliveryPayload,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<DeliveryPayload> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference