/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.mybusinessqanda.v1.model;

/**
 * Represents a single question and some of its answers.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the My Business Q&A API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Question extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The author of the question.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Author author;

  /**
   * Output only. The timestamp for when the question was written.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String createTime;

  /**
   * Immutable. The unique name for the question. locations/questions This field will be ignored if
   * set during question creation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Required. The text of the question. It should contain at least three words and the total length
   * should be greater than or equal to 10 characters. The maximum length is 4096 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String text;

  /**
   * Output only. A list of answers to the question, sorted by upvotes. This may not be a complete
   * list of answers depending on the request parameters (answers_per_question)
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Answer> topAnswers;

  static {
    // hack to force ProGuard to consider Answer used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(Answer.class);
  }

  /**
   * Output only. The total number of answers posted for this question.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer totalAnswerCount;

  /**
   * Output only. The timestamp for when the question was last modified.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String updateTime;

  /**
   * Output only. The number of upvotes for the question.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer upvoteCount;

  /**
   * Output only. The author of the question.
   * @return value or {@code null} for none
   */
  public Author getAuthor() {
    return author;
  }

  /**
   * Output only. The author of the question.
   * @param author author or {@code null} for none
   */
  public Question setAuthor(Author author) {
    this.author = author;
    return this;
  }

  /**
   * Output only. The timestamp for when the question was written.
   * @return value or {@code null} for none
   */
  public String getCreateTime() {
    return createTime;
  }

  /**
   * Output only. The timestamp for when the question was written.
   * @param createTime createTime or {@code null} for none
   */
  public Question setCreateTime(String createTime) {
    this.createTime = createTime;
    return this;
  }

  /**
   * Immutable. The unique name for the question. locations/questions This field will be ignored if
   * set during question creation.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Immutable. The unique name for the question. locations/questions This field will be ignored if
   * set during question creation.
   * @param name name or {@code null} for none
   */
  public Question setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Required. The text of the question. It should contain at least three words and the total length
   * should be greater than or equal to 10 characters. The maximum length is 4096 characters.
   * @return value or {@code null} for none
   */
  public java.lang.String getText() {
    return text;
  }

  /**
   * Required. The text of the question. It should contain at least three words and the total length
   * should be greater than or equal to 10 characters. The maximum length is 4096 characters.
   * @param text text or {@code null} for none
   */
  public Question setText(java.lang.String text) {
    this.text = text;
    return this;
  }

  /**
   * Output only. A list of answers to the question, sorted by upvotes. This may not be a complete
   * list of answers depending on the request parameters (answers_per_question)
   * @return value or {@code null} for none
   */
  public java.util.List<Answer> getTopAnswers() {
    return topAnswers;
  }

  /**
   * Output only. A list of answers to the question, sorted by upvotes. This may not be a complete
   * list of answers depending on the request parameters (answers_per_question)
   * @param topAnswers topAnswers or {@code null} for none
   */
  public Question setTopAnswers(java.util.List<Answer> topAnswers) {
    this.topAnswers = topAnswers;
    return this;
  }

  /**
   * Output only. The total number of answers posted for this question.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getTotalAnswerCount() {
    return totalAnswerCount;
  }

  /**
   * Output only. The total number of answers posted for this question.
   * @param totalAnswerCount totalAnswerCount or {@code null} for none
   */
  public Question setTotalAnswerCount(java.lang.Integer totalAnswerCount) {
    this.totalAnswerCount = totalAnswerCount;
    return this;
  }

  /**
   * Output only. The timestamp for when the question was last modified.
   * @return value or {@code null} for none
   */
  public String getUpdateTime() {
    return updateTime;
  }

  /**
   * Output only. The timestamp for when the question was last modified.
   * @param updateTime updateTime or {@code null} for none
   */
  public Question setUpdateTime(String updateTime) {
    this.updateTime = updateTime;
    return this;
  }

  /**
   * Output only. The number of upvotes for the question.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getUpvoteCount() {
    return upvoteCount;
  }

  /**
   * Output only. The number of upvotes for the question.
   * @param upvoteCount upvoteCount or {@code null} for none
   */
  public Question setUpvoteCount(java.lang.Integer upvoteCount) {
    this.upvoteCount = upvoteCount;
    return this;
  }

  @Override
  public Question set(String fieldName, Object value) {
    return (Question) super.set(fieldName, value);
  }

  @Override
  public Question clone() {
    return (Question) super.clone();
  }

}
