/*
 * 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.contentwarehouse.v1.model;

/**
 * Model definition for ImageMoosedogCrawlState.
 *
 * <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 Document AI Warehouse 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 ImageMoosedogCrawlState extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String code;

  /**
   * Each of the above not_crawled_reason will have a set of detailed reason defined in
   * crawler/trawler/trawler_enums.proto.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer detailedReason;

  /**
   * The status returned when RPCs are used to internally fetch the image (eg. from FIFE).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private UtilStatusProto internalStatus;

  /**
   * Specifies if the current crawl state is terminal.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isTerminal;

  /**
   * Time in seconds since epoch after which this image should be considered unavailable.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long noIndexAfterTimestamp;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String notCrawledReason;

  /**
   * When true, it means that a non-terminal state has overwrote a terminal one.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean overrodeTerminalState;

  /**
   * The repid for the urls. This repid is the id given to the dupe cluster this url belongs to.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String repid;

  /**
   * A comma separated list of user agents for which this image should be considered roboted. All
   * images are crawled using googlebot-images and this exists here purely for informative reasons.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String robotedAgents;

  /**
   * The url at which we crawled this content. With us starting to use repids the crawl table key no
   * longer is suggestive of the url. In addition this is used in Amarna to detect race conditions
   * between a reference changing its crawl directive and the original crawl job finishing.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String url;

  /**
   * Set to true if the url is taken down by clients. This indicates that this crawl state is used
   * to fast remove the crawl result of the url instead of waiting for Multiverse crawl results. For
   * more information, please refer to go/amarna-url-deletion.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean urlDeleted;

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getCode() {
    return code;
  }

  /**
   * @param code code or {@code null} for none
   */
  public ImageMoosedogCrawlState setCode(java.lang.String code) {
    this.code = code;
    return this;
  }

  /**
   * Each of the above not_crawled_reason will have a set of detailed reason defined in
   * crawler/trawler/trawler_enums.proto.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getDetailedReason() {
    return detailedReason;
  }

  /**
   * Each of the above not_crawled_reason will have a set of detailed reason defined in
   * crawler/trawler/trawler_enums.proto.
   * @param detailedReason detailedReason or {@code null} for none
   */
  public ImageMoosedogCrawlState setDetailedReason(java.lang.Integer detailedReason) {
    this.detailedReason = detailedReason;
    return this;
  }

  /**
   * The status returned when RPCs are used to internally fetch the image (eg. from FIFE).
   * @return value or {@code null} for none
   */
  public UtilStatusProto getInternalStatus() {
    return internalStatus;
  }

  /**
   * The status returned when RPCs are used to internally fetch the image (eg. from FIFE).
   * @param internalStatus internalStatus or {@code null} for none
   */
  public ImageMoosedogCrawlState setInternalStatus(UtilStatusProto internalStatus) {
    this.internalStatus = internalStatus;
    return this;
  }

  /**
   * Specifies if the current crawl state is terminal.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsTerminal() {
    return isTerminal;
  }

  /**
   * Specifies if the current crawl state is terminal.
   * @param isTerminal isTerminal or {@code null} for none
   */
  public ImageMoosedogCrawlState setIsTerminal(java.lang.Boolean isTerminal) {
    this.isTerminal = isTerminal;
    return this;
  }

  /**
   * Time in seconds since epoch after which this image should be considered unavailable.
   * @return value or {@code null} for none
   */
  public java.lang.Long getNoIndexAfterTimestamp() {
    return noIndexAfterTimestamp;
  }

  /**
   * Time in seconds since epoch after which this image should be considered unavailable.
   * @param noIndexAfterTimestamp noIndexAfterTimestamp or {@code null} for none
   */
  public ImageMoosedogCrawlState setNoIndexAfterTimestamp(java.lang.Long noIndexAfterTimestamp) {
    this.noIndexAfterTimestamp = noIndexAfterTimestamp;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getNotCrawledReason() {
    return notCrawledReason;
  }

  /**
   * @param notCrawledReason notCrawledReason or {@code null} for none
   */
  public ImageMoosedogCrawlState setNotCrawledReason(java.lang.String notCrawledReason) {
    this.notCrawledReason = notCrawledReason;
    return this;
  }

  /**
   * When true, it means that a non-terminal state has overwrote a terminal one.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getOverrodeTerminalState() {
    return overrodeTerminalState;
  }

  /**
   * When true, it means that a non-terminal state has overwrote a terminal one.
   * @param overrodeTerminalState overrodeTerminalState or {@code null} for none
   */
  public ImageMoosedogCrawlState setOverrodeTerminalState(java.lang.Boolean overrodeTerminalState) {
    this.overrodeTerminalState = overrodeTerminalState;
    return this;
  }

  /**
   * The repid for the urls. This repid is the id given to the dupe cluster this url belongs to.
   * @see #decodeRepid()
   * @return value or {@code null} for none
   */
  public java.lang.String getRepid() {
    return repid;
  }

  /**
   * The repid for the urls. This repid is the id given to the dupe cluster this url belongs to.
   * @see #getRepid()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeRepid() {
    return com.google.api.client.util.Base64.decodeBase64(repid);
  }

  /**
   * The repid for the urls. This repid is the id given to the dupe cluster this url belongs to.
   * @see #encodeRepid()
   * @param repid repid or {@code null} for none
   */
  public ImageMoosedogCrawlState setRepid(java.lang.String repid) {
    this.repid = repid;
    return this;
  }

  /**
   * The repid for the urls. This repid is the id given to the dupe cluster this url belongs to.
   * @see #setRepid()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public ImageMoosedogCrawlState encodeRepid(byte[] repid) {
    this.repid = com.google.api.client.util.Base64.encodeBase64URLSafeString(repid);
    return this;
  }

  /**
   * A comma separated list of user agents for which this image should be considered roboted. All
   * images are crawled using googlebot-images and this exists here purely for informative reasons.
   * @return value or {@code null} for none
   */
  public java.lang.String getRobotedAgents() {
    return robotedAgents;
  }

  /**
   * A comma separated list of user agents for which this image should be considered roboted. All
   * images are crawled using googlebot-images and this exists here purely for informative reasons.
   * @param robotedAgents robotedAgents or {@code null} for none
   */
  public ImageMoosedogCrawlState setRobotedAgents(java.lang.String robotedAgents) {
    this.robotedAgents = robotedAgents;
    return this;
  }

  /**
   * The url at which we crawled this content. With us starting to use repids the crawl table key no
   * longer is suggestive of the url. In addition this is used in Amarna to detect race conditions
   * between a reference changing its crawl directive and the original crawl job finishing.
   * @return value or {@code null} for none
   */
  public java.lang.String getUrl() {
    return url;
  }

  /**
   * The url at which we crawled this content. With us starting to use repids the crawl table key no
   * longer is suggestive of the url. In addition this is used in Amarna to detect race conditions
   * between a reference changing its crawl directive and the original crawl job finishing.
   * @param url url or {@code null} for none
   */
  public ImageMoosedogCrawlState setUrl(java.lang.String url) {
    this.url = url;
    return this;
  }

  /**
   * Set to true if the url is taken down by clients. This indicates that this crawl state is used
   * to fast remove the crawl result of the url instead of waiting for Multiverse crawl results. For
   * more information, please refer to go/amarna-url-deletion.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getUrlDeleted() {
    return urlDeleted;
  }

  /**
   * Set to true if the url is taken down by clients. This indicates that this crawl state is used
   * to fast remove the crawl result of the url instead of waiting for Multiverse crawl results. For
   * more information, please refer to go/amarna-url-deletion.
   * @param urlDeleted urlDeleted or {@code null} for none
   */
  public ImageMoosedogCrawlState setUrlDeleted(java.lang.Boolean urlDeleted) {
    this.urlDeleted = urlDeleted;
    return this;
  }

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

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

}
