org.dsa.iot.dslink.methods.requests.UnsubscribeRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dslink Show documentation
Show all versions of dslink Show documentation
SDK for the IoT DSA protocol
package org.dsa.iot.dslink.methods.requests;
import org.dsa.iot.dslink.methods.Request;
import org.dsa.iot.dslink.util.json.JsonArray;
import org.dsa.iot.dslink.util.json.JsonObject;
import java.util.List;
/**
* Unsubscribes to the designated subscription IDs.
*
* @author Samuel Grenier
*/
public class UnsubscribeRequest implements Request {
private final List sids;
public UnsubscribeRequest(List sids) {
if (sids == null) {
throw new IllegalArgumentException("sids");
}
this.sids = sids;
}
@Override
public String getName() {
return "unsubscribe";
}
@Override
public void addJsonValues(JsonObject out) {
out.put("sids", new JsonArray(sids));
}
}