<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/vulnerability.proto

namespace Grafeas\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A security vulnerability that can be found in resources.
 *
 * Generated from protobuf message <code>grafeas.v1.VulnerabilityNote</code>
 */
class VulnerabilityNote extends \Google\Protobuf\Internal\Message
{
    /**
     * 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.
     *
     * Generated from protobuf field <code>float cvss_score = 1;</code>
     */
    private $cvss_score = 0.0;
    /**
     * The note provider assigned severity of this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.Severity severity = 2;</code>
     */
    private $severity = 0;
    /**
     * Details of all known distros and packages affected by this vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.Detail details = 3;</code>
     */
    private $details;
    /**
     * The full description of the CVSSv3 for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSv3 cvss_v3 = 4;</code>
     */
    private $cvss_v3 = null;
    /**
     * Windows details get their own format because the information format and
     * model don't match a normal detail. Specifically Windows updates are done as
     * patches, thus Windows vulnerabilities really are a missing package, rather
     * than a package being at an incorrect version.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.WindowsDetail windows_details = 5;</code>
     */
    private $windows_details;
    /**
     * The time this information was last changed at the source. This is an
     * upstream timestamp from the underlying information source - e.g. Ubuntu
     * security tracker.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp source_update_time = 6;</code>
     */
    private $source_update_time = null;
    /**
     * CVSS version used to populate cvss_score and severity.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSVersion cvss_version = 7;</code>
     */
    private $cvss_version = 0;
    /**
     * The full description of the v2 CVSS for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSS cvss_v2 = 8;</code>
     */
    private $cvss_v2 = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $cvss_score
     *           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.
     *     @type int $severity
     *           The note provider assigned severity of this vulnerability.
     *     @type array<\Grafeas\V1\VulnerabilityNote\Detail>|\Google\Protobuf\Internal\RepeatedField $details
     *           Details of all known distros and packages affected by this vulnerability.
     *     @type \Grafeas\V1\CVSSv3 $cvss_v3
     *           The full description of the CVSSv3 for this vulnerability.
     *     @type array<\Grafeas\V1\VulnerabilityNote\WindowsDetail>|\Google\Protobuf\Internal\RepeatedField $windows_details
     *           Windows details get their own format because the information format and
     *           model don't match a normal detail. Specifically Windows updates are done as
     *           patches, thus Windows vulnerabilities really are a missing package, rather
     *           than a package being at an incorrect version.
     *     @type \Google\Protobuf\Timestamp $source_update_time
     *           The time this information was last changed at the source. This is an
     *           upstream timestamp from the underlying information source - e.g. Ubuntu
     *           security tracker.
     *     @type int $cvss_version
     *           CVSS version used to populate cvss_score and severity.
     *     @type \Grafeas\V1\CVSS $cvss_v2
     *           The full description of the v2 CVSS for this vulnerability.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Vulnerability::initOnce();
        parent::__construct($data);
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>float cvss_score = 1;</code>
     * @return float
     */
    public function getCvssScore()
    {
        return $this->cvss_score;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>float cvss_score = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setCvssScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->cvss_score = $var;

        return $this;
    }

    /**
     * The note provider assigned severity of this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.Severity severity = 2;</code>
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * The note provider assigned severity of this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.Severity severity = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\Severity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * Details of all known distros and packages affected by this vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.Detail details = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDetails()
    {
        return $this->details;
    }

    /**
     * Details of all known distros and packages affected by this vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.Detail details = 3;</code>
     * @param array<\Grafeas\V1\VulnerabilityNote\Detail>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\VulnerabilityNote\Detail::class);
        $this->details = $arr;

        return $this;
    }

    /**
     * The full description of the CVSSv3 for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSv3 cvss_v3 = 4;</code>
     * @return \Grafeas\V1\CVSSv3|null
     */
    public function getCvssV3()
    {
        return $this->cvss_v3;
    }

    public function hasCvssV3()
    {
        return isset($this->cvss_v3);
    }

    public function clearCvssV3()
    {
        unset($this->cvss_v3);
    }

    /**
     * The full description of the CVSSv3 for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSv3 cvss_v3 = 4;</code>
     * @param \Grafeas\V1\CVSSv3 $var
     * @return $this
     */
    public function setCvssV3($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\CVSSv3::class);
        $this->cvss_v3 = $var;

        return $this;
    }

    /**
     * Windows details get their own format because the information format and
     * model don't match a normal detail. Specifically Windows updates are done as
     * patches, thus Windows vulnerabilities really are a missing package, rather
     * than a package being at an incorrect version.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.WindowsDetail windows_details = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getWindowsDetails()
    {
        return $this->windows_details;
    }

    /**
     * Windows details get their own format because the information format and
     * model don't match a normal detail. Specifically Windows updates are done as
     * patches, thus Windows vulnerabilities really are a missing package, rather
     * than a package being at an incorrect version.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityNote.WindowsDetail windows_details = 5;</code>
     * @param array<\Grafeas\V1\VulnerabilityNote\WindowsDetail>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setWindowsDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\VulnerabilityNote\WindowsDetail::class);
        $this->windows_details = $arr;

        return $this;
    }

    /**
     * The time this information was last changed at the source. This is an
     * upstream timestamp from the underlying information source - e.g. Ubuntu
     * security tracker.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp source_update_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getSourceUpdateTime()
    {
        return $this->source_update_time;
    }

    public function hasSourceUpdateTime()
    {
        return isset($this->source_update_time);
    }

    public function clearSourceUpdateTime()
    {
        unset($this->source_update_time);
    }

    /**
     * The time this information was last changed at the source. This is an
     * upstream timestamp from the underlying information source - e.g. Ubuntu
     * security tracker.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp source_update_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setSourceUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->source_update_time = $var;

        return $this;
    }

    /**
     * CVSS version used to populate cvss_score and severity.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSVersion cvss_version = 7;</code>
     * @return int
     */
    public function getCvssVersion()
    {
        return $this->cvss_version;
    }

    /**
     * CVSS version used to populate cvss_score and severity.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSSVersion cvss_version = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setCvssVersion($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\CVSSVersion::class);
        $this->cvss_version = $var;

        return $this;
    }

    /**
     * The full description of the v2 CVSS for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSS cvss_v2 = 8;</code>
     * @return \Grafeas\V1\CVSS|null
     */
    public function getCvssV2()
    {
        return $this->cvss_v2;
    }

    public function hasCvssV2()
    {
        return isset($this->cvss_v2);
    }

    public function clearCvssV2()
    {
        unset($this->cvss_v2);
    }

    /**
     * The full description of the v2 CVSS for this vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.CVSS cvss_v2 = 8;</code>
     * @param \Grafeas\V1\CVSS $var
     * @return $this
     */
    public function setCvssV2($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\CVSS::class);
        $this->cvss_v2 = $var;

        return $this;
    }

}

