Interface Subscription

All Superinterfaces:
BaseResource, DomainResource<Subscription>, Identifiable<Subscription>, Versioned<Subscription>, WithKey

public interface Subscription extends BaseResource, DomainResource<Subscription>, WithKey
Subscription
Example to create an instance using the builder pattern

     Subscription subscription = Subscription.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .plusChanges(changesBuilder -> changesBuilder)
             .destination(destinationBuilder -> destinationBuilder)
             .plusMessages(messagesBuilder -> messagesBuilder)
             .format(formatBuilder -> formatBuilder)
             .status(SubscriptionHealthStatus.HEALTHY)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Subscription.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<Subscription>
      Specified by:
      getId in interface Identifiable<Subscription>
      Specified by:
      getId in interface Versioned<Subscription>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Subscription.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<Subscription>
      Specified by:
      getVersion in interface Versioned<Subscription>
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

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

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Subscription was last modified.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • getChanges

      @NotNull @Valid @NotNull @Valid List<ChangeSubscription> getChanges()

      Change notifications subscribed to.

      Returns:
      changes
    • getDestination

      @NotNull @Valid @NotNull @Valid Destination getDestination()

      Messaging service to which the messages are to be sent.

      Returns:
      destination
    • getKey

      String getKey()

      User-defined unique identifier of the Subscription.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getMessages

      @NotNull @Valid @NotNull @Valid List<MessageSubscription> getMessages()

      Messages subscribed to.

      Returns:
      messages
    • getFormat

      @NotNull @Valid @NotNull @Valid DeliveryFormat getFormat()

      Format in which the payload is delivered.

      Returns:
      format
    • getStatus

      @NotNull @NotNull SubscriptionHealthStatus getStatus()

      Status of the Subscription.

      Returns:
      status
    • setId

      void setId(String id)

      Unique identifier of the Subscription.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Subscription.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

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

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Subscription was last modified.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      createdBy - value to be set
    • setChanges

      void setChanges(ChangeSubscription... changes)

      Change notifications subscribed to.

      Parameters:
      changes - values to be set
    • setChanges

      void setChanges(List<ChangeSubscription> changes)

      Change notifications subscribed to.

      Parameters:
      changes - values to be set
    • setDestination

      void setDestination(Destination destination)

      Messaging service to which the messages are to be sent.

      Parameters:
      destination - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Subscription.

      Parameters:
      key - value to be set
    • setMessages

      void setMessages(MessageSubscription... messages)

      Messages subscribed to.

      Parameters:
      messages - values to be set
    • setMessages

      void setMessages(List<MessageSubscription> messages)

      Messages subscribed to.

      Parameters:
      messages - values to be set
    • setFormat

      void setFormat(DeliveryFormat format)

      Format in which the payload is delivered.

      Parameters:
      format - value to be set
    • setStatus

      void setStatus(SubscriptionHealthStatus status)

      Status of the Subscription.

      Parameters:
      status - value to be set
    • of

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

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

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

      static SubscriptionBuilder builder()
      builder factory method for Subscription
      Returns:
      builder
    • builder

      static SubscriptionBuilder builder(Subscription template)
      create builder for Subscription instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSubscription

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