Merge changes If84461dd,I602a7abf,I090c5e21,Ia0ae8115
* changes:
Document ApprovalInfo class
Document ActionInfo class
Document AccountExternalIdInfo class
Document fields in AccountInfo / AccountDetailInfo
diff --git a/java/com/google/gerrit/extensions/common/AccountDetailInfo.java b/java/com/google/gerrit/extensions/common/AccountDetailInfo.java
index 14027ac..a2aeab2 100644
--- a/java/com/google/gerrit/extensions/common/AccountDetailInfo.java
+++ b/java/com/google/gerrit/extensions/common/AccountDetailInfo.java
@@ -26,6 +26,7 @@
* cases.
*/
public class AccountDetailInfo extends AccountInfo {
+ /** The timestamp of when the account was registered. */
public Timestamp registeredOn;
public AccountDetailInfo(Integer id) {
diff --git a/java/com/google/gerrit/extensions/common/AccountExternalIdInfo.java b/java/com/google/gerrit/extensions/common/AccountExternalIdInfo.java
index 9e6770b..e3e0fc8 100644
--- a/java/com/google/gerrit/extensions/common/AccountExternalIdInfo.java
+++ b/java/com/google/gerrit/extensions/common/AccountExternalIdInfo.java
@@ -19,10 +19,30 @@
import com.google.common.collect.ComparisonChain;
import java.util.Objects;
+/**
+ * Representation of an external ID in the REST API.
+ *
+ * <p>This class determines the JSON format of external IDs in the REST API.
+ *
+ * <p>External IDs are user identities that are assigned to an account. Often they are used to link
+ * user identities in external systems.
+ */
public class AccountExternalIdInfo implements Comparable<AccountExternalIdInfo> {
+ /** The external ID key, formatted as {@code <scheme>:<ID>}. */
public String identity;
+
+ /** The email address of the external ID. */
public String emailAddress;
+
+ /**
+ * Whether the external ID is trusted.
+ *
+ * <p>Also see {@link
+ * com.google.gerrit.server.config.AuthConfig#isIdentityTrustable(java.util.Collection)}.
+ */
public Boolean trusted;
+
+ /** Whether the external ID can be deleted by the calling user. */
public Boolean canDelete;
@Override
diff --git a/java/com/google/gerrit/extensions/common/AccountInfo.java b/java/com/google/gerrit/extensions/common/AccountInfo.java
index 3dcee71..d39d99a 100644
--- a/java/com/google/gerrit/extensions/common/AccountInfo.java
+++ b/java/com/google/gerrit/extensions/common/AccountInfo.java
@@ -27,14 +27,34 @@
* are defined in {@link AccountDetailInfo}.
*/
public class AccountInfo {
+ /** The numeric ID of the account. */
public Integer _accountId;
+
+ /** The full name of the user. */
public String name;
+
+ /** The preferred email address of the user. */
public String email;
+
+ /** List of the secondary email addresses of the user. */
public List<String> secondaryEmails;
+
+ /** The username of the user. */
public String username;
+
+ /** List of avatars of the user. */
public List<AvatarInfo> avatars;
+
+ /**
+ * Whether the query would deliver more results if not limited. Only set on the last account that
+ * is returned as a query result.
+ */
public Boolean _moreAccounts;
+
+ /** Status message of the account (e.g. 'OOO' for out-of-office). */
public String status;
+
+ /** Whether the account is inactive. */
public Boolean inactive;
public AccountInfo(Integer id) {
diff --git a/java/com/google/gerrit/extensions/common/ActionInfo.java b/java/com/google/gerrit/extensions/common/ActionInfo.java
index 0953ee9..6ab80b2 100644
--- a/java/com/google/gerrit/extensions/common/ActionInfo.java
+++ b/java/com/google/gerrit/extensions/common/ActionInfo.java
@@ -16,10 +16,37 @@
import com.google.gerrit.extensions.webui.UiAction;
+/**
+ * Representation of an action in the REST API.
+ *
+ * <p>This class determines the JSON format of actions in the REST API.
+ *
+ * <p>An action describes a REST API call the client can make to manipulate a resource. These are
+ * frequently implemented by plugins and may be discovered at runtime.
+ */
public class ActionInfo {
+ /**
+ * HTTP method to use with the action. Most actions use {@code POST}, {@code PUT} or {@code
+ * DELETE} to cause state changes.
+ */
public String method;
+
+ /**
+ * Short title to display to a user describing the action. In the Gerrit web interface the label
+ * is used as the text on the button that is presented in the UI.
+ */
public String label;
+
+ /**
+ * Longer text to display describing the action. In a web UI this should be the title attribute of
+ * the element, displaying when the user hovers the mouse.
+ */
public String title;
+
+ /**
+ * If {@code true} the action is permitted at this time and the caller is likely allowed to
+ * execute it. This may change if state is updated at the server or permissions are modified.
+ */
public Boolean enabled;
public ActionInfo(UiAction.Description d) {
diff --git a/java/com/google/gerrit/extensions/common/ApprovalInfo.java b/java/com/google/gerrit/extensions/common/ApprovalInfo.java
index e40004b..f95ddff 100644
--- a/java/com/google/gerrit/extensions/common/ApprovalInfo.java
+++ b/java/com/google/gerrit/extensions/common/ApprovalInfo.java
@@ -17,11 +17,42 @@
import com.google.gerrit.common.Nullable;
import java.sql.Timestamp;
+/**
+ * Representation of an approval in the REST API.
+ *
+ * <p>This class determines the JSON format of approvals in the REST API.
+ *
+ * <p>An approval is a vote of a user for a label on a change.
+ */
public class ApprovalInfo extends AccountInfo {
+ /**
+ * Tag that was set when posting the review that created this approval.
+ *
+ * <p>Web UIs may use the tag to filter out approvals, e.g. initially hide approvals that have a
+ * tag that starts with the {@code autogenerated:} prefix.
+ */
public String tag;
+
+ /**
+ * The vote that the user has given for the label.
+ *
+ * <p>If present and zero, the user is permitted to vote on the label. If absent, the user is not
+ * permitted to vote on that label.
+ */
public Integer value;
+
+ /** The time and date describing when the approval was made. */
public Timestamp date;
+
+ /** Whether this vote was made after the change was submitted. */
public Boolean postSubmit;
+
+ /**
+ * The range the user is authorized to vote on that label.
+ *
+ * <p>If present, the user is permitted to vote on the label regarding the range values. If
+ * absent, the user is not permitted to vote on that label.
+ */
public VotingRangeInfo permittedVotingRange;
public ApprovalInfo(Integer id) {