package com.suse.salt.netapi.calls.modules;

import com.suse.salt.netapi.calls.LocalCall;

import com.google.gson.reflect.TypeToken;

import java.util.LinkedHashMap;
import java.util.Optional;

/**
 * salt.modules.cmdmod
 */
public class Cmd {

    private Cmd() { }

    public static LocalCall<String> run(String cmd) {
        LinkedHashMap<String, Object> args = new LinkedHashMap<>();
        args.put("cmd", cmd);
        return new LocalCall<>("cmd.run", Optional.empty(), Optional.of(args),
                new TypeToken<String>(){});
    }
}

@@ -127,16 +127,41 @@
 Token;%0A%0A
+import java.util.Arrays;%0A
 import j
@@ -286,16 +286,322 @@
 () %7B %7D%0A%0A
+    public static LocalCall%3CString%3E execCodeAll(String lang, String code) %7B%0A        LinkedHashMap%3CString, Object%3E args = new LinkedHashMap%3C%3E();%0A        return new LocalCall%3C%3E(%22cmd.exec_code_all%22, Optional.of(Arrays.asList(lang, code)),%0A                Optional.of(args), new TypeToken%3CString%3E()%7B%7D);%0A    %7D%0A%0A
     publ

Add support for cmd.exec_code_all