package xyz.pushpad;

import org.json.simple.JSONObject;

/**
 * <p>You can include action buttons inside your notifications. In this way, a notification can have multiple links or actions.</p>
 * <img src="https://pushpad.xyz/assets/action_buttons-a1397c39c36f4ea02a6d9d00132fe3b1be697c138f0db9b11a8310ab558a1719.png" alt="Action buttons">
 * <p>When you send a notification you can add any number of action buttons. Each action button has the following fields:</p>
 * <ul>
 *  <li><b>Title</b>: the label displayed to the user for the action button.</li>
 *  <li><b>Link</b> (optional): the page that opens up when the user clicks the button. If you leave it blank, the main link of the notification will be used.</li>
 *  <li><b>Icon</b> (optional): the URL of a small icon for the action button. An alternative to icons is to include emoticons or other symbols inside the title.</li>
 *  <li><b>Action</b> (optional): an ID for the action that can be used to trigger a Javascript callback. If a Javascript action with that ID is defined, it will be executed. Otherwise the action ID will be ignored and the link will be used instead.</li>
 * </ul> 
 * @see <a href="https://pushpad.xyz/docs/action_buttons">https://pushpad.xyz/docs/action_buttons</a>
 */
public class ActionButton {

  /** The title. */
  private final String title;

  /** The link. */
  private String targetUrl;

  /** The icon. */
  private String icon;

  /** The action. */
  private String action;

  /**
   * Instantiates a new action button.
   *
   * @param title
   *          the title
   * @throws IllegalArgumentException
   *           if the new title exceeds the maximum length of 20 characters
   */
  public ActionButton(String title) throws IllegalArgumentException {
    if (title.length()>20){
      throw new IllegalArgumentException("Maximum length of the title is 20 characters");
    }
    this.title = title;
  }

  /**
   * Sets the target url.
   *
   * @param targetUrl          the new target url
   * @return a reference to this object.
   */
  public ActionButton setTargetUrl(String targetUrl) {
    this.targetUrl = targetUrl;
    return this;
  }

  /**
   * Sets the icon url.
   *
   * @param icon
   *          the new icon url
   * @return a reference to this object.
   */
  public ActionButton setIcon(String icon) {
    this.icon = icon;
    return this;
  }

  /**
   * Sets the action.
   *
   * @param action
   *          the new action
   * @return a reference to this object.
   * @throws IllegalArgumentException
   *           if the new action exceeds the maximum length of 50 characters
   */
  public ActionButton setAction(String action) throws IllegalArgumentException {
    if (action.length() > 50) {
      throw new IllegalArgumentException("Maximum length of the action is 50 characters");
    }
    this.action = action;
    return this;
  }

  /**
   * Converts the ActionButton to a JSONObject.
   *
   * @return the JSONObject
   */
  @SuppressWarnings("unchecked")
  public JSONObject toJson() {
    JSONObject result = new JSONObject();
    result.put("title", title);
    result.put("target_url", targetUrl);
    result.put("icon", icon);
    result.put("action", action);
    return result;
  }
}

@@ -55,1317 +55,67 @@
 t;%0A%0A
-/**%0A * %3Cp%3EYou can include action buttons inside your notifications. In this way, a notification can have multiple links or actions.%3C/p%3E%0A * %3Cimg src=%22https://pushpad.xyz/assets/action_buttons-a1397c39c36f4ea02a6d9d00132fe3b1be697c138f0db9b11a8310ab558a1719.png%22 alt=%22Action buttons%22%3E%0A * %3Cp%3EWhen you send a notification you can add any number of action buttons. Each action button has the following fields:%3C/p%3E%0A * %3Cul%3E%0A *  %3Cli%3E%3Cb%3ETitle%3C/b%3E: the label displayed to the user for the action button.%3C/li%3E%0A *  %3Cli%3E%3Cb%3ELink%3C/b%3E (optional): the page that opens up when the user clicks the button. If you leave it blank, the main link of the notification will be used.%3C/li%3E%0A *  %3Cli%3E%3Cb%3EIcon%3C/b%3E (optional): the URL of a small icon for the action button. An alternative to icons is to include emoticons or other symbols inside the title.%3C/li%3E%0A *  %3Cli%3E%3Cb%3EAction%3C/b%3E (optional): an ID for the action that can be used to trigger a Javascript callback. If a Javascript action with that ID is defined, it will be executed. Otherwise the action ID will be ignored and the link will be used instead.%3C/li%3E%0A * %3C/ul%3E %0A * @see %3Ca href=%22https://pushpad.xyz/docs/action_buttons%22%3Ehttps://pushpad.xyz/docs/action_buttons%3C/a%3E%0A */%0Apublic class ActionButton %7B%0A%0A  /** The title. */%0A  private final String title;%0A%0A  /** The link. */%0A  private
+public class ActionButton %7B%0A  public String title;%0A  public
  Str
@@ -133,1799 +133,395 @@
 rl;%0A
-%0A
   
-/** The icon. */%0A  private String icon;%0A%0A  /** The action. */%0A  private String action;%0A%0A  /**%0A   * Instantiates a new action button.%0A   *%0A   * @param title%0A   *          the title%0A   * @throws IllegalArgumentException%0A   *           if the new title exceeds the maximum length of 20 characters%0A   */%0A  public ActionButton(String title) throws IllegalArgumentException %7B%0A    if (title.length()%3E20)%7B%0A      throw new IllegalArgumentException(%22Maximum length of the title is 20 characters%22);%0A    %7D%0A    this.title = title;%0A  %7D%0A%0A  /**%0A   * Sets the target url.%0A   *%0A   * @param targetUrl          the new target url%0A   * @return a reference to this object.%0A   */%0A  public ActionButton setTargetUrl(String targetUrl) %7B%0A    this.targetUrl = targetUrl;%0A    return this;%0A  %7D%0A%0A  /**%0A   * Sets the icon url.%0A   *%0A   * @param icon%0A   *          the new icon url%0A   * @return a reference to this object.%0A   */%0A  public ActionButton setIcon(String icon) %7B%0A    this.icon = icon;%0A    return this;%0A  %7D%0A%0A  /**%0A   * Sets the action.%0A   *%0A   * @param action%0A   *          the new action%0A   * @return a reference to this object.%0A   * @throws IllegalArgumentException%0A   *           if the new action exceeds the maximum length of 50 characters%0A   */%0A  public ActionButton setAction(String action) throws IllegalArgumentException %7B%0A    if (action.length() %3E 50) %7B%0A      throw new IllegalArgumentException(%22Maximum length of the action is 50 characters%22);%0A    %7D%0A    this.action = action;%0A    return this;%0A  %7D%0A%0A  /**%0A   * Converts the ActionButton to a JSONObject.%0A   *%0A   * @return the JSONObject%0A   */%0A  @SuppressWarnings(%22unchecked%22)%0A  public JSONObject toJson() %7B%0A    JSONObject result = new JSONObject();%0A    result.put(%22title%22, title);%0A    result.put(%22target_url%22, targetUrl);%0A    result.put(%22icon%22, icon);%0A
+public String icon;%0A  public String action;%0A%0A  public ActionButton(String title) %7B%0A    this.title = title;%0A  %7D%0A%0A  public JSONObject toJson() %7B%0A    JSONObject result = new JSONObject();%0A    result.put(%22title%22, title);%0A    if (targetUrl != null) %7B%0A      result.put(%22target_url%22, targetUrl);%0A    %7D%0A    if (icon != null) %7B%0A      result.put(%22icon%22, icon);%0A    %7D%0A    if (action != null) %7B%0A  
     
@@ -546,24 +546,30 @@
 %22, action);%0A
+    %7D%0A
     return r

Use same coding style for action buttons