All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dsa.iot.dslink.methods.requests.UnsubscribeRequest Maven / Gradle / Ivy

There is a newer version: 0.24.2
Show newest version
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));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy