package com.clxcommunications.xms.api;

import java.net.URI;
import java.util.List;

import javax.annotation.Nullable;
import javax.annotation.OverridingMethodsMustInvokeSuper;

import org.threeten.bp.OffsetDateTime;

import com.clxcommunications.xms.UpdateValue;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 * Objects of this type can be used to update previously submitted MT batches.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY,
        property = "type")
@JsonSubTypes({
        @Type(MtBatchTextSmsUpdate.class),
        @Type(MtBatchBinarySmsUpdate.class)
})
public abstract class MtBatchSmsUpdate {

	/**
	 * The message destinations to add to the batch.
	 * 
	 * @return a list of MSISDNs or group IDs
	 */
	@Nullable
	@JsonProperty("to_add")
	public abstract List<String> toAdd();

	/**
	 * The message destinations to remove from the batch.
	 * 
	 * @return a list of MSISDNs or group IDs
	 */
	@Nullable
	@JsonProperty("to_remove")
	public abstract List<String> toRemove();

	/**
	 * The message originator.
	 * 
	 * @return an MSISDN or short code
	 */
	@Nullable
	public abstract String from();

	@Nullable
	@JsonProperty("delivery_report")
	public abstract UpdateValue<ReportType> deliveryReport();

	@Nullable
	@JsonProperty("send_at")
	public abstract UpdateValue<OffsetDateTime> sendAt();

	@Nullable
	@JsonProperty("expire_at")
	public abstract UpdateValue<OffsetDateTime> expireAt();

	@Nullable
	@JsonProperty("callback_url")
	public abstract UpdateValue<URI> callbackUrl();

	@OverridingMethodsMustInvokeSuper
	protected void check() {
	}

}

@@ -1769,14 +1769,120 @@
 eck() %7B%0A
+%09%09if (from() != null && from().isEmpty()) %7B%0A%09%09%09throw new IllegalStateException(%22empty from address%22);%0A%09%09%7D%0A
 %09%7D%0A%0A%7D%0A

Add simple verification