Interface Subscription
- All Superinterfaces:
BaseResource
,DomainResource<Subscription>
,Identifiable<Subscription>
,Versioned<Subscription>
,WithKey
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 Summary
Modifier and TypeMethodDescriptionstatic SubscriptionBuilder
builder()
builder factory method for Subscriptionstatic SubscriptionBuilder
builder
(Subscription template) create builder for Subscription instancestatic Subscription
deepCopy
(Subscription template) factory method to create a deep copy of Subscription@NotNull @Valid List<ChangeSubscription>
Changes subscribed to.@NotNull ZonedDateTime
Date and time (UTC) the Subscription was initially created.@Valid CreatedBy
IDs and references that created the Subscription.@NotNull @Valid Destination
Messaging service to which the notifications are sent.@NotNull @Valid DeliveryFormat
Format in which the payload is delivered.@NotNull String
getId()
Unique identifier of the Subscription.getKey()
User-defined unique identifier of the Subscription.@NotNull ZonedDateTime
Date and time (UTC) the Subscription was last modified.@Valid LastModifiedBy
IDs and references that last modified the Subscription.@NotNull @Valid List<MessageSubscription>
Messages subscribed to.@NotNull SubscriptionHealthStatus
Status of the Subscription.@NotNull Long
Current version of the Subscription.static Subscription
of()
factory methodstatic Subscription
of
(Subscription template) factory method to create a shallow copy Subscriptionvoid
setChanges
(ChangeSubscription... changes) Changes subscribed to.void
setChanges
(List<ChangeSubscription> changes) Changes subscribed to.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Subscription was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the Subscription.void
setDestination
(Destination destination) Messaging service to which the notifications are sent.void
setFormat
(DeliveryFormat format) Format in which the payload is delivered.void
Unique identifier of the Subscription.void
User-defined unique identifier of the Subscription.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Subscription was last modified.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Subscription.void
setMessages
(MessageSubscription... messages) Messages subscribed to.void
setMessages
(List<MessageSubscription> messages) Messages subscribed to.void
setStatus
(SubscriptionHealthStatus status) Status of the Subscription.void
setVersion
(Long version) Current version of the Subscription.static com.fasterxml.jackson.core.type.TypeReference<Subscription>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withSubscription
(Function<Subscription, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.DomainResource
get
-
Method Details
-
getId
Unique identifier of the Subscription.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<Subscription>
- Specified by:
getId
in interfaceIdentifiable<Subscription>
- Specified by:
getId
in interfaceVersioned<Subscription>
- Returns:
- id
-
getVersion
Current version of the Subscription.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<Subscription>
- Specified by:
getVersion
in interfaceVersioned<Subscription>
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Subscription was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Subscription was last modified.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Subscription.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Subscription.
- Returns:
- createdBy
-
getChanges
Changes subscribed to.
- Returns:
- changes
-
getDestination
Messaging service to which the notifications are sent.
- Returns:
- destination
-
getKey
String getKey()User-defined unique identifier of the Subscription.
-
getMessages
Messages subscribed to.
- Returns:
- messages
-
getFormat
Format in which the payload is delivered.
- Returns:
- format
-
getStatus
Status of the Subscription.
- Returns:
- status
-
setId
Unique identifier of the Subscription.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Subscription.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the Subscription was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Subscription was last modified.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
IDs and references that last modified the Subscription.
- Parameters:
lastModifiedBy
- value to be set
-
setCreatedBy
IDs and references that created the Subscription.
- Parameters:
createdBy
- value to be set
-
setChanges
Changes subscribed to.
- Parameters:
changes
- values to be set
-
setChanges
Changes subscribed to.
- Parameters:
changes
- values to be set
-
setDestination
Messaging service to which the notifications are sent.
- Parameters:
destination
- value to be set
-
setKey
User-defined unique identifier of the Subscription.
- Parameters:
key
- value to be set
-
setMessages
Messages subscribed to.
- Parameters:
messages
- values to be set
-
setMessages
Messages subscribed to.
- Parameters:
messages
- values to be set
-
setFormat
Format in which the payload is delivered.
- Parameters:
format
- value to be set
-
setStatus
Status of the Subscription.
- Parameters:
status
- value to be set
-
of
factory method- Returns:
- instance of Subscription
-
of
factory method to create a shallow copy Subscription- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Subscription- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Subscription- Returns:
- builder
-
builder
create builder for Subscription instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withSubscription
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-