Interface EventDeliveryPayload

All Superinterfaces:
SubscriptionNotification

public interface EventDeliveryPayload extends SubscriptionNotification

This payload is sent for an EventSubscription.


Example to create an instance using the builder pattern

     EventDeliveryPayload eventDeliveryPayload = EventDeliveryPayload.builder()
             .id("{id}")
             .type(EventType.CHECKOUT_ORDER_CREATION_FAILED)
             .resourceType("{resourceType}")
             .data(dataBuilder -> dataBuilder)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .build()
 
  • Field Details

  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Event.

      Returns:
      id
    • getType

      @NotNull @NotNull EventType getType()

      The type of Event that has occurred.

      Returns:
      type
    • getResourceType

      @NotNull @NotNull String getResourceType()

      The type of resource targeted by the Event.

      Returns:
      resourceType
    • getData

      @NotNull @Valid @NotNull @Valid Object getData()

      The data describing the event that has taken place.

      Returns:
      data
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the resource was initially created.

      Returns:
      createdAt
    • setId

      void setId(String id)

      Unique identifier of the Event.

      Parameters:
      id - value to be set
    • setType

      void setType(EventType type)

      The type of Event that has occurred.

      Parameters:
      type - value to be set
    • setResourceType

      void setResourceType(String resourceType)

      The type of resource targeted by the Event.

      Parameters:
      resourceType - value to be set
    • setData

      void setData(Object data)

      The data describing the event that has taken place.

      Parameters:
      data - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the resource was initially created.

      Parameters:
      createdAt - value to be set
    • of

      static EventDeliveryPayload of()
      factory method
      Returns:
      instance of EventDeliveryPayload
    • of

      factory method to create a shallow copy EventDeliveryPayload
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface SubscriptionNotification
    • deepCopy

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

      static EventDeliveryPayloadBuilder builder()
      builder factory method for EventDeliveryPayload
      Returns:
      builder
    • builder

      create builder for EventDeliveryPayload instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withEventDeliveryPayload

      default <T> T withEventDeliveryPayload(Function<EventDeliveryPayload,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<EventDeliveryPayload> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference