public final class AddInterfaceInteraction extends SetCustomTypeBase<Payment>
See also PaymentUpdateCommand.
withUpdateableType(client(), type -> { withPayment(client(), payment -> { final AddInterfaceInteraction addInterfaceInteraction = AddInterfaceInteraction.ofTypeIdAndObjects(type.getId(), singletonMap(STRING_FIELD_NAME, "some id")); final Payment updatedPayment = client().executeBlocking(PaymentUpdateCommand.of(payment, addInterfaceInteraction)); assertThat(updatedPayment.getInterfaceInteractions().get(0).getFieldAsString(STRING_FIELD_NAME)).isEqualTo("some id"); assertEventually(() -> { final PagedQueryResult<PaymentInteractionAddedMessage> pagedQueryResult = client().executeBlocking(MessageQuery.of() .withPredicates(m -> m.resource().is(payment)) .forMessageType(PaymentInteractionAddedMessage.MESSAGE_HINT)); assertThat(pagedQueryResult.head()).isPresent(); assertThat(pagedQueryResult.head().get().getInteraction().getFieldAsString(STRING_FIELD_NAME)).isEqualTo("some id"); }); return updatedPayment; }); return type; });
See the test code.
Modifier and Type | Method and Description |
---|---|
static AddInterfaceInteraction |
ofTypeIdAndJson(String typeId,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields) |
static AddInterfaceInteraction |
ofTypeIdAndObjects(String typeId,
Map<String,Object> fields) |
static AddInterfaceInteraction |
ofTypeIdAndObjects(String typeId,
String fieldName,
Object value) |
static AddInterfaceInteraction |
ofTypeKeyAndJson(String typeKey,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields) |
static AddInterfaceInteraction |
ofTypeKeyAndObjects(String typeKey,
Map<String,Object> fields) |
static AddInterfaceInteraction |
ofTypeKeyAndObjects(String typeKey,
String fieldName,
Object value) |
static String |
resourceTypeId()
Gets the resource type id for the custom field creation.
|
getFields, getType, mapObjectToJsonMap
getAction
public static String resourceTypeId()
TypeDraft.getResourceTypeIds()
,
Custom
public static AddInterfaceInteraction ofTypeKeyAndObjects(String typeKey, Map<String,Object> fields)
public static AddInterfaceInteraction ofTypeIdAndObjects(String typeId, Map<String,Object> fields)
public static AddInterfaceInteraction ofTypeKeyAndObjects(String typeKey, String fieldName, Object value)
public static AddInterfaceInteraction ofTypeIdAndObjects(String typeId, String fieldName, Object value)
public static AddInterfaceInteraction ofTypeIdAndJson(String typeId, Map<String,com.fasterxml.jackson.databind.JsonNode> fields)
public static AddInterfaceInteraction ofTypeKeyAndJson(String typeKey, Map<String,com.fasterxml.jackson.databind.JsonNode> fields)