Interface EventSubscription


public interface EventSubscription

For EventSubscription, the format of the payload is custom for each specific notification.


Example to create an instance using the builder pattern

     EventSubscription eventSubscription = EventSubscription.builder()
             .resourceTypeId(EventSubscriptionResourceTypeId.CHECKOUT)
             .build()
 
  • Method Details

    • getResourceTypeId

      @NotNull @NotNull EventSubscriptionResourceTypeId getResourceTypeId()

      Unique identifier for the type of resource.

      Returns:
      resourceTypeId
    • getTypes

      List<EventType> getTypes()

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

      Returns:
      types
    • setResourceTypeId

      void setResourceTypeId(EventSubscriptionResourceTypeId resourceTypeId)

      Unique identifier for the type of resource.

      Parameters:
      resourceTypeId - value to be set
    • setTypes

      void setTypes(EventType... types)

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

      Parameters:
      types - values to be set
    • setTypes

      void setTypes(List<EventType> types)

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

      Parameters:
      types - values to be set
    • of

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

      static EventSubscription of(EventSubscription template)
      factory method to create a shallow copy EventSubscription
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      EventSubscription copyDeep()
    • deepCopy

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

      static EventSubscriptionBuilder builder()
      builder factory method for EventSubscription
      Returns:
      builder
    • builder

      static EventSubscriptionBuilder builder(EventSubscription template)
      create builder for EventSubscription instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withEventSubscription

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