Merge changes If84461dd,I602a7abf,I090c5e21,Ia0ae8115

* changes:
  Document ApprovalInfo class
  Document ActionInfo class
  Document AccountExternalIdInfo class
  Document fields in AccountInfo /  AccountDetailInfo
This commit is contained in:
David Pursehouse
2020-01-09 00:54:06 +00:00
committed by Gerrit Code Review
5 changed files with 99 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ import java.sql.Timestamp;
* cases.
*/
public class AccountDetailInfo extends AccountInfo {
/** The timestamp of when the account was registered. */
public Timestamp registeredOn;
public AccountDetailInfo(Integer id) {

View File

@@ -19,10 +19,30 @@ import static com.google.common.base.MoreObjects.toStringHelper;
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

View File

@@ -27,14 +27,34 @@ import java.util.Objects;
* 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) {

View File

@@ -16,10 +16,37 @@ package com.google.gerrit.extensions.common;
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) {

View File

@@ -17,11 +17,42 @@ package com.google.gerrit.extensions.common;
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) {