// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.extensions.common;

import com.google.gerrit.common.Nullable;
import java.sql.Timestamp;

public class ApprovalInfo extends AccountInfo {
  public String tag;
  public Integer value;
  public Timestamp date;
  public Boolean postSubmit;
  public VotingRangeInfo permittedVotingRange;

  public ApprovalInfo(Integer id) {
    super(id);
  }

  public ApprovalInfo(
      Integer id,
      Integer value,
      @Nullable VotingRangeInfo permittedVotingRange,
      @Nullable String tag,
      Timestamp date) {
    super(id);
    this.value = value;
    this.permittedVotingRange = permittedVotingRange;
    this.date = date;
    this.tag = tag;
  }
}

@@ -722,154 +722,1186 @@
 p;%0A%0A
-public class ApprovalInfo extends AccountInfo %7B%0A  public String tag;%0A  public Integer value;%0A  public Timestamp date;%0A  public Boolean postSubmit;
+/**%0A * Representation of an approval in the REST API.%0A *%0A * %3Cp%3EThis class determines the JSON format of approvals in the REST API.%0A *%0A * %3Cp%3EAn approval is a vote of a user for a label on a change.%0A */%0Apublic class ApprovalInfo extends AccountInfo %7B%0A  /**%0A   * Tag that was set when posting the review that created this approval.%0A   *%0A   * %3Cp%3EWeb UIs may use the tag to filter out approvals, e.g. initially hide approvals that have a%0A   * tag that starts with the %7B@code autogenerated:%7D prefix.%0A   */%0A  public String tag;%0A%0A  /**%0A   * The vote that the user has given for the label.%0A   *%0A   * %3Cp%3EIf present and zero, the user is permitted to vote on the label. If absent, the user is not%0A   * permitted to vote on that label.%0A   */%0A  public Integer value;%0A%0A  /** The time and date describing when the approval was made. */%0A  public Timestamp date;%0A%0A  /** Whether this vote was made after the change was submitted. */%0A  public Boolean postSubmit;%0A%0A  /**%0A   * The range the user is authorized to vote on that label.%0A   *%0A   * %3Cp%3EIf present, the user is permitted to vote on the label regarding the range values. If%0A   * absent, the user is not permitted to vote on that label.%0A   */
 %0A  p

Document ApprovalInfo class