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

namespace Grafeas\V1\VulnerabilityOccurrence;

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

/**
 * VexAssessment provides all publisher provided Vex information that is
 * related to this vulnerability.
 *
 * Generated from protobuf message <code>grafeas.v1.VulnerabilityOccurrence.VexAssessment</code>
 */
class VexAssessment extends \Google\Protobuf\Internal\Message
{
    /**
     * Holds the MITRE standard Common Vulnerabilities and Exposures (CVE)
     * tracking number for the vulnerability.
     *
     * Generated from protobuf field <code>string cve = 1;</code>
     */
    private $cve = '';
    /**
     * Holds a list of references associated with this vulnerability item and
     * assessment.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_uris = 2;</code>
     */
    private $related_uris;
    /**
     * The VulnerabilityAssessment note from which this VexAssessment was
     * generated.
     * This will be of the form: `projects/[PROJECT_ID]/notes/[NOTE_ID]`.
     * (-- api-linter: core::0122::name-suffix=disabled
     *     aip.dev/not-precedent: The suffix is kept for consistency. --)
     *
     * Generated from protobuf field <code>string note_name = 3;</code>
     */
    private $note_name = '';
    /**
     * Provides the state of this Vulnerability assessment.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.State state = 4;</code>
     */
    private $state = 0;
    /**
     * Contains information about the impact of this vulnerability,
     * this will change with time.
     *
     * Generated from protobuf field <code>repeated string impacts = 5;</code>
     */
    private $impacts;
    /**
     * Specifies details on how to handle (and presumably, fix) a vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityAssessmentNote.Assessment.Remediation remediations = 6;</code>
     */
    private $remediations;
    /**
     * Justification provides the justification when the state of the
     * assessment if NOT_AFFECTED.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.Justification justification = 7;</code>
     */
    private $justification = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $cve
     *           Holds the MITRE standard Common Vulnerabilities and Exposures (CVE)
     *           tracking number for the vulnerability.
     *     @type array<\Grafeas\V1\RelatedUrl>|\Google\Protobuf\Internal\RepeatedField $related_uris
     *           Holds a list of references associated with this vulnerability item and
     *           assessment.
     *     @type string $note_name
     *           The VulnerabilityAssessment note from which this VexAssessment was
     *           generated.
     *           This will be of the form: `projects/[PROJECT_ID]/notes/[NOTE_ID]`.
     *           (-- api-linter: core::0122::name-suffix=disabled
     *               aip.dev/not-precedent: The suffix is kept for consistency. --)
     *     @type int $state
     *           Provides the state of this Vulnerability assessment.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $impacts
     *           Contains information about the impact of this vulnerability,
     *           this will change with time.
     *     @type array<\Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Remediation>|\Google\Protobuf\Internal\RepeatedField $remediations
     *           Specifies details on how to handle (and presumably, fix) a vulnerability.
     *     @type \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Justification $justification
     *           Justification provides the justification when the state of the
     *           assessment if NOT_AFFECTED.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Vulnerability::initOnce();
        parent::__construct($data);
    }

    /**
     * Holds the MITRE standard Common Vulnerabilities and Exposures (CVE)
     * tracking number for the vulnerability.
     *
     * Generated from protobuf field <code>string cve = 1;</code>
     * @return string
     */
    public function getCve()
    {
        return $this->cve;
    }

    /**
     * Holds the MITRE standard Common Vulnerabilities and Exposures (CVE)
     * tracking number for the vulnerability.
     *
     * Generated from protobuf field <code>string cve = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setCve($var)
    {
        GPBUtil::checkString($var, True);
        $this->cve = $var;

        return $this;
    }

    /**
     * Holds a list of references associated with this vulnerability item and
     * assessment.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_uris = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRelatedUris()
    {
        return $this->related_uris;
    }

    /**
     * Holds a list of references associated with this vulnerability item and
     * assessment.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_uris = 2;</code>
     * @param array<\Grafeas\V1\RelatedUrl>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRelatedUris($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\RelatedUrl::class);
        $this->related_uris = $arr;

        return $this;
    }

    /**
     * The VulnerabilityAssessment note from which this VexAssessment was
     * generated.
     * This will be of the form: `projects/[PROJECT_ID]/notes/[NOTE_ID]`.
     * (-- api-linter: core::0122::name-suffix=disabled
     *     aip.dev/not-precedent: The suffix is kept for consistency. --)
     *
     * Generated from protobuf field <code>string note_name = 3;</code>
     * @return string
     */
    public function getNoteName()
    {
        return $this->note_name;
    }

    /**
     * The VulnerabilityAssessment note from which this VexAssessment was
     * generated.
     * This will be of the form: `projects/[PROJECT_ID]/notes/[NOTE_ID]`.
     * (-- api-linter: core::0122::name-suffix=disabled
     *     aip.dev/not-precedent: The suffix is kept for consistency. --)
     *
     * Generated from protobuf field <code>string note_name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setNoteName($var)
    {
        GPBUtil::checkString($var, True);
        $this->note_name = $var;

        return $this;
    }

    /**
     * Provides the state of this Vulnerability assessment.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.State state = 4;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Provides the state of this Vulnerability assessment.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.State state = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Contains information about the impact of this vulnerability,
     * this will change with time.
     *
     * Generated from protobuf field <code>repeated string impacts = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getImpacts()
    {
        return $this->impacts;
    }

    /**
     * Contains information about the impact of this vulnerability,
     * this will change with time.
     *
     * Generated from protobuf field <code>repeated string impacts = 5;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setImpacts($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->impacts = $arr;

        return $this;
    }

    /**
     * Specifies details on how to handle (and presumably, fix) a vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityAssessmentNote.Assessment.Remediation remediations = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRemediations()
    {
        return $this->remediations;
    }

    /**
     * Specifies details on how to handle (and presumably, fix) a vulnerability.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.VulnerabilityAssessmentNote.Assessment.Remediation remediations = 6;</code>
     * @param array<\Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Remediation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRemediations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Remediation::class);
        $this->remediations = $arr;

        return $this;
    }

    /**
     * Justification provides the justification when the state of the
     * assessment if NOT_AFFECTED.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.Justification justification = 7;</code>
     * @return \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Justification|null
     */
    public function getJustification()
    {
        return $this->justification;
    }

    public function hasJustification()
    {
        return isset($this->justification);
    }

    public function clearJustification()
    {
        unset($this->justification);
    }

    /**
     * Justification provides the justification when the state of the
     * assessment if NOT_AFFECTED.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote.Assessment.Justification justification = 7;</code>
     * @param \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Justification $var
     * @return $this
     */
    public function setJustification($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Justification::class);
        $this->justification = $var;

        return $this;
    }

}


