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

/**
 * An occurrence of a severity vulnerability on a resource.
 *
 * <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 On-Demand Scanning 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 VulnerabilityOccurrence extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 where 0
   * indicates low severity and 10 indicates high severity.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Float cvssScore;

  /**
   * The cvss v3 score for the vulnerability.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private CVSS cvssv3;

  /**
   * The distro assigned severity for this vulnerability when it is available, otherwise this is the
   * note provider assigned severity. When there are multiple PackageIssues for this vulnerability,
   * they can have different effective severities because some might be provided by the distro while
   * others are provided by the language ecosystem for a language pack. For this reason, it is
   * advised to use the effective severity on the PackageIssue level. In the case where multiple
   * PackageIssues have differing effective severities, this field should be the highest severity
   * for any of the PackageIssues.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String effectiveSeverity;

  /**
   * Output only. Whether at least one of the affected packages has a fix available.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean fixAvailable;

  /**
   * Output only. A detailed description of this vulnerability.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String longDescription;

  /**
   * Required. The set of affected locations and their fixes (if available) within the associated
   * resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<PackageIssue> packageIssue;

  static {
    // hack to force ProGuard to consider PackageIssue 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(PackageIssue.class);
  }

  /**
   * Output only. URLs related to this vulnerability.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<RelatedUrl> relatedUrls;

  static {
    // hack to force ProGuard to consider RelatedUrl 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(RelatedUrl.class);
  }

  /**
   * Output only. The note provider assigned severity of this vulnerability.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String severity;

  /**
   * Output only. A one sentence description of this vulnerability.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String shortDescription;

  /**
   * The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String type;

  /**
   * Output only. The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 where 0
   * indicates low severity and 10 indicates high severity.
   * @return value or {@code null} for none
   */
  public java.lang.Float getCvssScore() {
    return cvssScore;
  }

  /**
   * Output only. The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 where 0
   * indicates low severity and 10 indicates high severity.
   * @param cvssScore cvssScore or {@code null} for none
   */
  public VulnerabilityOccurrence setCvssScore(java.lang.Float cvssScore) {
    this.cvssScore = cvssScore;
    return this;
  }

  /**
   * The cvss v3 score for the vulnerability.
   * @return value or {@code null} for none
   */
  public CVSS getCvssv3() {
    return cvssv3;
  }

  /**
   * The cvss v3 score for the vulnerability.
   * @param cvssv3 cvssv3 or {@code null} for none
   */
  public VulnerabilityOccurrence setCvssv3(CVSS cvssv3) {
    this.cvssv3 = cvssv3;
    return this;
  }

  /**
   * The distro assigned severity for this vulnerability when it is available, otherwise this is the
   * note provider assigned severity. When there are multiple PackageIssues for this vulnerability,
   * they can have different effective severities because some might be provided by the distro while
   * others are provided by the language ecosystem for a language pack. For this reason, it is
   * advised to use the effective severity on the PackageIssue level. In the case where multiple
   * PackageIssues have differing effective severities, this field should be the highest severity
   * for any of the PackageIssues.
   * @return value or {@code null} for none
   */
  public java.lang.String getEffectiveSeverity() {
    return effectiveSeverity;
  }

  /**
   * The distro assigned severity for this vulnerability when it is available, otherwise this is the
   * note provider assigned severity. When there are multiple PackageIssues for this vulnerability,
   * they can have different effective severities because some might be provided by the distro while
   * others are provided by the language ecosystem for a language pack. For this reason, it is
   * advised to use the effective severity on the PackageIssue level. In the case where multiple
   * PackageIssues have differing effective severities, this field should be the highest severity
   * for any of the PackageIssues.
   * @param effectiveSeverity effectiveSeverity or {@code null} for none
   */
  public VulnerabilityOccurrence setEffectiveSeverity(java.lang.String effectiveSeverity) {
    this.effectiveSeverity = effectiveSeverity;
    return this;
  }

  /**
   * Output only. Whether at least one of the affected packages has a fix available.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getFixAvailable() {
    return fixAvailable;
  }

  /**
   * Output only. Whether at least one of the affected packages has a fix available.
   * @param fixAvailable fixAvailable or {@code null} for none
   */
  public VulnerabilityOccurrence setFixAvailable(java.lang.Boolean fixAvailable) {
    this.fixAvailable = fixAvailable;
    return this;
  }

  /**
   * Output only. A detailed description of this vulnerability.
   * @return value or {@code null} for none
   */
  public java.lang.String getLongDescription() {
    return longDescription;
  }

  /**
   * Output only. A detailed description of this vulnerability.
   * @param longDescription longDescription or {@code null} for none
   */
  public VulnerabilityOccurrence setLongDescription(java.lang.String longDescription) {
    this.longDescription = longDescription;
    return this;
  }

  /**
   * Required. The set of affected locations and their fixes (if available) within the associated
   * resource.
   * @return value or {@code null} for none
   */
  public java.util.List<PackageIssue> getPackageIssue() {
    return packageIssue;
  }

  /**
   * Required. The set of affected locations and their fixes (if available) within the associated
   * resource.
   * @param packageIssue packageIssue or {@code null} for none
   */
  public VulnerabilityOccurrence setPackageIssue(java.util.List<PackageIssue> packageIssue) {
    this.packageIssue = packageIssue;
    return this;
  }

  /**
   * Output only. URLs related to this vulnerability.
   * @return value or {@code null} for none
   */
  public java.util.List<RelatedUrl> getRelatedUrls() {
    return relatedUrls;
  }

  /**
   * Output only. URLs related to this vulnerability.
   * @param relatedUrls relatedUrls or {@code null} for none
   */
  public VulnerabilityOccurrence setRelatedUrls(java.util.List<RelatedUrl> relatedUrls) {
    this.relatedUrls = relatedUrls;
    return this;
  }

  /**
   * Output only. The note provider assigned severity of this vulnerability.
   * @return value or {@code null} for none
   */
  public java.lang.String getSeverity() {
    return severity;
  }

  /**
   * Output only. The note provider assigned severity of this vulnerability.
   * @param severity severity or {@code null} for none
   */
  public VulnerabilityOccurrence setSeverity(java.lang.String severity) {
    this.severity = severity;
    return this;
  }

  /**
   * Output only. A one sentence description of this vulnerability.
   * @return value or {@code null} for none
   */
  public java.lang.String getShortDescription() {
    return shortDescription;
  }

  /**
   * Output only. A one sentence description of this vulnerability.
   * @param shortDescription shortDescription or {@code null} for none
   */
  public VulnerabilityOccurrence setShortDescription(java.lang.String shortDescription) {
    this.shortDescription = shortDescription;
    return this;
  }

  /**
   * The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
   * @return value or {@code null} for none
   */
  public java.lang.String getType() {
    return type;
  }

  /**
   * The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
   * @param type type or {@code null} for none
   */
  public VulnerabilityOccurrence setType(java.lang.String type) {
    this.type = type;
    return this;
  }

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

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

}
