@@ -0,0 +1,2617 @@
+package com.suse.saltstack.netapi.calls.modules;%0A%0Aimport com.google.gson.reflect.TypeToken;%0Aimport com.suse.saltstack.netapi.calls.LocalCall;%0A%0Aimport java.time.LocalDateTime;%0Aimport java.time.format.DateTimeFormatter;%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0Aimport java.util.Optional;%0A%0A/**%0A * salt.modules.schedule%0A */%0Apublic class Schedule %7B%0A%0A    private Schedule() %7B%0A    %7D%0A%0A    /**%0A     * Common result structure for scheduling functions%0A     */%0A    public static class Result %7B%0A%0A        private String comment;%0A        private boolean result;%0A%0A        /**%0A         * Construct a new Result%0A         * @param commentIn Human readable comment%0A         * @param resultIn boolean indicating success%0A         */%0A        public Result(String commentIn, boolean resultIn) %7B%0A            this.comment = commentIn;%0A            this.result = resultIn;%0A        %7D%0A%0A        /**%0A         * boolean indicating success%0A         * @return boolean indicating success%0A         */%0A        public boolean getResult() %7B%0A            return result;%0A        %7D%0A%0A        /**%0A         * Human readable comment%0A         * @return Human readable comment%0A         */%0A        public String getComment() %7B%0A            return comment;%0A        %7D%0A%0A    %7D%0A%0A    /**%0A     * Delete a schedule entry%0A     * @param name job name%0A     * @return the result%0A     */%0A    public static LocalCall%3CResult%3E delete(String name) %7B%0A        LinkedHashMap%3CString, Object%3E args = new LinkedHashMap%3C%3E();%0A        args.put(%22name%22, name);%0A        return new LocalCall%3C%3E(%22schedule.delete%22, Optional.empty(), Optional.of(args),%0A                new TypeToken%3CResult%3E() %7B %7D);%0A    %7D%0A%0A    /**%0A     * Schedule a salt call for later execution on the minion%0A     * @param name job name%0A     * @param call salt call schedule%0A     * @param once when to execute it once%0A     * @param metadata additional metadata%0A     * @return call object to execute via the client%0A     */%0A    public static LocalCall%3CResult%3E add(String name, LocalCall%3C?%3E call,%0A            LocalDateTime once, Map%3CString, ?%3E metadata) %7B%0A        LinkedHashMap%3CString, Object%3E args = new LinkedHashMap%3C%3E();%0A        Map%3CString, Object%3E payload = call.getPayload();%0A        args.put(%22function%22, payload.get(%22fun%22));%0A        args.put(%22job_args%22, payload.get(%22arg%22));%0A        args.put(%22job_kwargs%22, payload.get(%22kwarg%22));%0A%0A        args.put(%22name%22, name);%0A        args.put(%22once%22, once.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));%0A        args.put(%22metadata%22, metadata);%0A        return new LocalCall%3C%3E(%22schedule.add%22, Optional.empty(), Optional.of(args),%0A                new TypeToken%3CResult%3E() %7B %7D);%0A    %7D%0A%0A%7D%0A

add inital schedule module