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

namespace Grafeas\V1;

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

/**
 * An instance of an analysis type that has been found on a resource.
 *
 * Generated from protobuf message <code>grafeas.v1.Occurrence</code>
 */
class Occurrence extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The name of the occurrence in the form of
     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Required. Immutable. A URI that represents the resource for which the
     * occurrence applies. For example,
     * `https://gcr.io/project/image&#64;sha256:123abc` for a Docker image.
     *
     * Generated from protobuf field <code>string resource_uri = 2;</code>
     */
    private $resource_uri = '';
    /**
     * Required. Immutable. The analysis note associated with this occurrence, in
     * the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
     * used as a filter in list requests.
     *
     * Generated from protobuf field <code>string note_name = 3;</code>
     */
    private $note_name = '';
    /**
     * Output only. This explicitly denotes which of the occurrence details are
     * specified. This field can be used as a filter in list requests.
     *
     * Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
     */
    private $kind = 0;
    /**
     * A description of actions that can be taken to remedy the note.
     *
     * Generated from protobuf field <code>string remediation = 5;</code>
     */
    private $remediation = '';
    /**
     * Output only. The time this occurrence was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</code>
     */
    private $create_time = null;
    /**
     * Output only. The time this occurrence was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7;</code>
     */
    private $update_time = null;
    /**
     * https://github.com/secure-systems-lab/dsse
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 18;</code>
     */
    private $envelope = null;
    protected $details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The name of the occurrence in the form of
     *           `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
     *     @type string $resource_uri
     *           Required. Immutable. A URI that represents the resource for which the
     *           occurrence applies. For example,
     *           `https://gcr.io/project/image&#64;sha256:123abc` for a Docker image.
     *     @type string $note_name
     *           Required. Immutable. The analysis note associated with this occurrence, in
     *           the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
     *           used as a filter in list requests.
     *     @type int $kind
     *           Output only. This explicitly denotes which of the occurrence details are
     *           specified. This field can be used as a filter in list requests.
     *     @type string $remediation
     *           A description of actions that can be taken to remedy the note.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time this occurrence was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time this occurrence was last updated.
     *     @type \Grafeas\V1\VulnerabilityOccurrence $vulnerability
     *           Describes a security vulnerability.
     *     @type \Grafeas\V1\BuildOccurrence $build
     *           Describes a verifiable build.
     *     @type \Grafeas\V1\ImageOccurrence $image
     *           Describes how this resource derives from the basis in the associated
     *           note.
     *     @type \Grafeas\V1\PackageOccurrence $package
     *           Describes the installation of a package on the linked resource.
     *     @type \Grafeas\V1\DeploymentOccurrence $deployment
     *           Describes the deployment of an artifact on a runtime.
     *     @type \Grafeas\V1\DiscoveryOccurrence $discovery
     *           Describes when a resource was discovered.
     *     @type \Grafeas\V1\AttestationOccurrence $attestation
     *           Describes an attestation of an artifact.
     *     @type \Grafeas\V1\UpgradeOccurrence $upgrade
     *           Describes an available package upgrade on the linked resource.
     *     @type \Grafeas\V1\ComplianceOccurrence $compliance
     *           Describes a compliance violation on a linked resource.
     *     @type \Grafeas\V1\DSSEAttestationOccurrence $dsse_attestation
     *           Describes an attestation of an artifact using dsse.
     *     @type \Grafeas\V1\Envelope $envelope
     *           https://github.com/secure-systems-lab/dsse
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Grafeas::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The name of the occurrence in the form of
     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The name of the occurrence in the form of
     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. Immutable. A URI that represents the resource for which the
     * occurrence applies. For example,
     * `https://gcr.io/project/image&#64;sha256:123abc` for a Docker image.
     *
     * Generated from protobuf field <code>string resource_uri = 2;</code>
     * @return string
     */
    public function getResourceUri()
    {
        return $this->resource_uri;
    }

    /**
     * Required. Immutable. A URI that represents the resource for which the
     * occurrence applies. For example,
     * `https://gcr.io/project/image&#64;sha256:123abc` for a Docker image.
     *
     * Generated from protobuf field <code>string resource_uri = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setResourceUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_uri = $var;

        return $this;
    }

    /**
     * Required. Immutable. The analysis note associated with this occurrence, in
     * the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
     * used as a filter in list requests.
     *
     * Generated from protobuf field <code>string note_name = 3;</code>
     * @return string
     */
    public function getNoteName()
    {
        return $this->note_name;
    }

    /**
     * Required. Immutable. The analysis note associated with this occurrence, in
     * the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
     * used as a filter in list requests.
     *
     * 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;
    }

    /**
     * Output only. This explicitly denotes which of the occurrence details are
     * specified. This field can be used as a filter in list requests.
     *
     * Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
     * @return int
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Output only. This explicitly denotes which of the occurrence details are
     * specified. This field can be used as a filter in list requests.
     *
     * Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\NoteKind::class);
        $this->kind = $var;

        return $this;
    }

    /**
     * A description of actions that can be taken to remedy the note.
     *
     * Generated from protobuf field <code>string remediation = 5;</code>
     * @return string
     */
    public function getRemediation()
    {
        return $this->remediation;
    }

    /**
     * A description of actions that can be taken to remedy the note.
     *
     * Generated from protobuf field <code>string remediation = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setRemediation($var)
    {
        GPBUtil::checkString($var, True);
        $this->remediation = $var;

        return $this;
    }

    /**
     * Output only. The time this occurrence was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time this occurrence was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time this occurrence was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The time this occurrence was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Describes a security vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityOccurrence vulnerability = 8;</code>
     * @return \Grafeas\V1\VulnerabilityOccurrence|null
     */
    public function getVulnerability()
    {
        return $this->readOneof(8);
    }

    public function hasVulnerability()
    {
        return $this->hasOneof(8);
    }

    /**
     * Describes a security vulnerability.
     *
     * Generated from protobuf field <code>.grafeas.v1.VulnerabilityOccurrence vulnerability = 8;</code>
     * @param \Grafeas\V1\VulnerabilityOccurrence $var
     * @return $this
     */
    public function setVulnerability($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\VulnerabilityOccurrence::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Describes a verifiable build.
     *
     * Generated from protobuf field <code>.grafeas.v1.BuildOccurrence build = 9;</code>
     * @return \Grafeas\V1\BuildOccurrence|null
     */
    public function getBuild()
    {
        return $this->readOneof(9);
    }

    public function hasBuild()
    {
        return $this->hasOneof(9);
    }

    /**
     * Describes a verifiable build.
     *
     * Generated from protobuf field <code>.grafeas.v1.BuildOccurrence build = 9;</code>
     * @param \Grafeas\V1\BuildOccurrence $var
     * @return $this
     */
    public function setBuild($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\BuildOccurrence::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Describes how this resource derives from the basis in the associated
     * note.
     *
     * Generated from protobuf field <code>.grafeas.v1.ImageOccurrence image = 10;</code>
     * @return \Grafeas\V1\ImageOccurrence|null
     */
    public function getImage()
    {
        return $this->readOneof(10);
    }

    public function hasImage()
    {
        return $this->hasOneof(10);
    }

    /**
     * Describes how this resource derives from the basis in the associated
     * note.
     *
     * Generated from protobuf field <code>.grafeas.v1.ImageOccurrence image = 10;</code>
     * @param \Grafeas\V1\ImageOccurrence $var
     * @return $this
     */
    public function setImage($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\ImageOccurrence::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Describes the installation of a package on the linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.PackageOccurrence package = 11;</code>
     * @return \Grafeas\V1\PackageOccurrence|null
     */
    public function getPackage()
    {
        return $this->readOneof(11);
    }

    public function hasPackage()
    {
        return $this->hasOneof(11);
    }

    /**
     * Describes the installation of a package on the linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.PackageOccurrence package = 11;</code>
     * @param \Grafeas\V1\PackageOccurrence $var
     * @return $this
     */
    public function setPackage($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\PackageOccurrence::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * Describes the deployment of an artifact on a runtime.
     *
     * Generated from protobuf field <code>.grafeas.v1.DeploymentOccurrence deployment = 12;</code>
     * @return \Grafeas\V1\DeploymentOccurrence|null
     */
    public function getDeployment()
    {
        return $this->readOneof(12);
    }

    public function hasDeployment()
    {
        return $this->hasOneof(12);
    }

    /**
     * Describes the deployment of an artifact on a runtime.
     *
     * Generated from protobuf field <code>.grafeas.v1.DeploymentOccurrence deployment = 12;</code>
     * @param \Grafeas\V1\DeploymentOccurrence $var
     * @return $this
     */
    public function setDeployment($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\DeploymentOccurrence::class);
        $this->writeOneof(12, $var);

        return $this;
    }

    /**
     * Describes when a resource was discovered.
     *
     * Generated from protobuf field <code>.grafeas.v1.DiscoveryOccurrence discovery = 13;</code>
     * @return \Grafeas\V1\DiscoveryOccurrence|null
     */
    public function getDiscovery()
    {
        return $this->readOneof(13);
    }

    public function hasDiscovery()
    {
        return $this->hasOneof(13);
    }

    /**
     * Describes when a resource was discovered.
     *
     * Generated from protobuf field <code>.grafeas.v1.DiscoveryOccurrence discovery = 13;</code>
     * @param \Grafeas\V1\DiscoveryOccurrence $var
     * @return $this
     */
    public function setDiscovery($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\DiscoveryOccurrence::class);
        $this->writeOneof(13, $var);

        return $this;
    }

    /**
     * Describes an attestation of an artifact.
     *
     * Generated from protobuf field <code>.grafeas.v1.AttestationOccurrence attestation = 14;</code>
     * @return \Grafeas\V1\AttestationOccurrence|null
     */
    public function getAttestation()
    {
        return $this->readOneof(14);
    }

    public function hasAttestation()
    {
        return $this->hasOneof(14);
    }

    /**
     * Describes an attestation of an artifact.
     *
     * Generated from protobuf field <code>.grafeas.v1.AttestationOccurrence attestation = 14;</code>
     * @param \Grafeas\V1\AttestationOccurrence $var
     * @return $this
     */
    public function setAttestation($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\AttestationOccurrence::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * Describes an available package upgrade on the linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.UpgradeOccurrence upgrade = 15;</code>
     * @return \Grafeas\V1\UpgradeOccurrence|null
     */
    public function getUpgrade()
    {
        return $this->readOneof(15);
    }

    public function hasUpgrade()
    {
        return $this->hasOneof(15);
    }

    /**
     * Describes an available package upgrade on the linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.UpgradeOccurrence upgrade = 15;</code>
     * @param \Grafeas\V1\UpgradeOccurrence $var
     * @return $this
     */
    public function setUpgrade($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\UpgradeOccurrence::class);
        $this->writeOneof(15, $var);

        return $this;
    }

    /**
     * Describes a compliance violation on a linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.ComplianceOccurrence compliance = 16;</code>
     * @return \Grafeas\V1\ComplianceOccurrence|null
     */
    public function getCompliance()
    {
        return $this->readOneof(16);
    }

    public function hasCompliance()
    {
        return $this->hasOneof(16);
    }

    /**
     * Describes a compliance violation on a linked resource.
     *
     * Generated from protobuf field <code>.grafeas.v1.ComplianceOccurrence compliance = 16;</code>
     * @param \Grafeas\V1\ComplianceOccurrence $var
     * @return $this
     */
    public function setCompliance($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\ComplianceOccurrence::class);
        $this->writeOneof(16, $var);

        return $this;
    }

    /**
     * Describes an attestation of an artifact using dsse.
     *
     * Generated from protobuf field <code>.grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17;</code>
     * @return \Grafeas\V1\DSSEAttestationOccurrence|null
     */
    public function getDsseAttestation()
    {
        return $this->readOneof(17);
    }

    public function hasDsseAttestation()
    {
        return $this->hasOneof(17);
    }

    /**
     * Describes an attestation of an artifact using dsse.
     *
     * Generated from protobuf field <code>.grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17;</code>
     * @param \Grafeas\V1\DSSEAttestationOccurrence $var
     * @return $this
     */
    public function setDsseAttestation($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\DSSEAttestationOccurrence::class);
        $this->writeOneof(17, $var);

        return $this;
    }

    /**
     * https://github.com/secure-systems-lab/dsse
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 18;</code>
     * @return \Grafeas\V1\Envelope|null
     */
    public function getEnvelope()
    {
        return $this->envelope;
    }

    public function hasEnvelope()
    {
        return isset($this->envelope);
    }

    public function clearEnvelope()
    {
        unset($this->envelope);
    }

    /**
     * https://github.com/secure-systems-lab/dsse
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 18;</code>
     * @param \Grafeas\V1\Envelope $var
     * @return $this
     */
    public function setEnvelope($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\Envelope::class);
        $this->envelope = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getDetails()
    {
        return $this->whichOneof("details");
    }

}

