/*
 * 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.websecurityscanner.v1alpha.model;

/**
 * A ScanRun is a output-only resource representing an actual run of the scan.
 *
 * <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 Web Security Scanner 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 ScanRun extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The time at which the ScanRun reached termination state - that the ScanRun is
   * either finished or stopped by user.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String endTime;

  /**
   * Output only. The execution state of the ScanRun.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String executionState;

  /**
   * Output only. Whether the scan run has found any vulnerabilities.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean hasVulnerabilities;

  /**
   * Output only. The resource name of the ScanRun. The name follows the format of
   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The ScanRun IDs are
   * generated by the system.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Output only. The percentage of total completion ranging from 0 to 100. If the scan is in queue,
   * the value is 0. If the scan is running, the value ranges from 0 to 100. If the scan is
   * finished, the value is 100.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer progressPercent;

  /**
   * Output only. The result state of the ScanRun. This field is only available after the execution
   * state reaches "FINISHED".
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resultState;

  /**
   * Output only. The time at which the ScanRun started.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String startTime;

  /**
   * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs crawled up to now.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long urlsCrawledCount;

  /**
   * Output only. The number of URLs tested during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs tested up to now. The number of URLs tested is usually
   * larger than the number URLS crawled because typically a crawled URL is tested with multiple
   * test payloads.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long urlsTestedCount;

  /**
   * Output only. The time at which the ScanRun reached termination state - that the ScanRun is
   * either finished or stopped by user.
   * @return value or {@code null} for none
   */
  public String getEndTime() {
    return endTime;
  }

  /**
   * Output only. The time at which the ScanRun reached termination state - that the ScanRun is
   * either finished or stopped by user.
   * @param endTime endTime or {@code null} for none
   */
  public ScanRun setEndTime(String endTime) {
    this.endTime = endTime;
    return this;
  }

  /**
   * Output only. The execution state of the ScanRun.
   * @return value or {@code null} for none
   */
  public java.lang.String getExecutionState() {
    return executionState;
  }

  /**
   * Output only. The execution state of the ScanRun.
   * @param executionState executionState or {@code null} for none
   */
  public ScanRun setExecutionState(java.lang.String executionState) {
    this.executionState = executionState;
    return this;
  }

  /**
   * Output only. Whether the scan run has found any vulnerabilities.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getHasVulnerabilities() {
    return hasVulnerabilities;
  }

  /**
   * Output only. Whether the scan run has found any vulnerabilities.
   * @param hasVulnerabilities hasVulnerabilities or {@code null} for none
   */
  public ScanRun setHasVulnerabilities(java.lang.Boolean hasVulnerabilities) {
    this.hasVulnerabilities = hasVulnerabilities;
    return this;
  }

  /**
   * Output only. The resource name of the ScanRun. The name follows the format of
   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The ScanRun IDs are
   * generated by the system.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Output only. The resource name of the ScanRun. The name follows the format of
   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The ScanRun IDs are
   * generated by the system.
   * @param name name or {@code null} for none
   */
  public ScanRun setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Output only. The percentage of total completion ranging from 0 to 100. If the scan is in queue,
   * the value is 0. If the scan is running, the value ranges from 0 to 100. If the scan is
   * finished, the value is 100.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getProgressPercent() {
    return progressPercent;
  }

  /**
   * Output only. The percentage of total completion ranging from 0 to 100. If the scan is in queue,
   * the value is 0. If the scan is running, the value ranges from 0 to 100. If the scan is
   * finished, the value is 100.
   * @param progressPercent progressPercent or {@code null} for none
   */
  public ScanRun setProgressPercent(java.lang.Integer progressPercent) {
    this.progressPercent = progressPercent;
    return this;
  }

  /**
   * Output only. The result state of the ScanRun. This field is only available after the execution
   * state reaches "FINISHED".
   * @return value or {@code null} for none
   */
  public java.lang.String getResultState() {
    return resultState;
  }

  /**
   * Output only. The result state of the ScanRun. This field is only available after the execution
   * state reaches "FINISHED".
   * @param resultState resultState or {@code null} for none
   */
  public ScanRun setResultState(java.lang.String resultState) {
    this.resultState = resultState;
    return this;
  }

  /**
   * Output only. The time at which the ScanRun started.
   * @return value or {@code null} for none
   */
  public String getStartTime() {
    return startTime;
  }

  /**
   * Output only. The time at which the ScanRun started.
   * @param startTime startTime or {@code null} for none
   */
  public ScanRun setStartTime(String startTime) {
    this.startTime = startTime;
    return this;
  }

  /**
   * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs crawled up to now.
   * @return value or {@code null} for none
   */
  public java.lang.Long getUrlsCrawledCount() {
    return urlsCrawledCount;
  }

  /**
   * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs crawled up to now.
   * @param urlsCrawledCount urlsCrawledCount or {@code null} for none
   */
  public ScanRun setUrlsCrawledCount(java.lang.Long urlsCrawledCount) {
    this.urlsCrawledCount = urlsCrawledCount;
    return this;
  }

  /**
   * Output only. The number of URLs tested during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs tested up to now. The number of URLs tested is usually
   * larger than the number URLS crawled because typically a crawled URL is tested with multiple
   * test payloads.
   * @return value or {@code null} for none
   */
  public java.lang.Long getUrlsTestedCount() {
    return urlsTestedCount;
  }

  /**
   * Output only. The number of URLs tested during this ScanRun. If the scan is in progress, the
   * value represents the number of URLs tested up to now. The number of URLs tested is usually
   * larger than the number URLS crawled because typically a crawled URL is tested with multiple
   * test payloads.
   * @param urlsTestedCount urlsTestedCount or {@code null} for none
   */
  public ScanRun setUrlsTestedCount(java.lang.Long urlsTestedCount) {
    this.urlsTestedCount = urlsTestedCount;
    return this;
  }

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

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

}
