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

namespace Grafeas\V1;

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

/**
 * Deprecated. Prefer to use a regular Occurrence, and populate the
 * Envelope at the top level of the Occurrence.
 *
 * Generated from protobuf message <code>grafeas.v1.DSSEAttestationOccurrence</code>
 */
class DSSEAttestationOccurrence extends \Google\Protobuf\Internal\Message
{
    /**
     * If doing something security critical, make sure to verify the signatures in
     * this metadata.
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 1;</code>
     */
    private $envelope = null;
    protected $decoded_payload;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Grafeas\V1\Envelope $envelope
     *           If doing something security critical, make sure to verify the signatures in
     *           this metadata.
     *     @type \Grafeas\V1\InTotoStatement $statement
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\DsseAttestation::initOnce();
        parent::__construct($data);
    }

    /**
     * If doing something security critical, make sure to verify the signatures in
     * this metadata.
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 1;</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);
    }

    /**
     * If doing something security critical, make sure to verify the signatures in
     * this metadata.
     *
     * Generated from protobuf field <code>.grafeas.v1.Envelope envelope = 1;</code>
     * @param \Grafeas\V1\Envelope $var
     * @return $this
     */
    public function setEnvelope($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\Envelope::class);
        $this->envelope = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grafeas.v1.InTotoStatement statement = 2;</code>
     * @return \Grafeas\V1\InTotoStatement|null
     */
    public function getStatement()
    {
        return $this->readOneof(2);
    }

    public function hasStatement()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.grafeas.v1.InTotoStatement statement = 2;</code>
     * @param \Grafeas\V1\InTotoStatement $var
     * @return $this
     */
    public function setStatement($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\InTotoStatement::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

