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

namespace Google\Cloud\Dataform\V1\ReleaseConfig;

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

/**
 * A record of an attempt to create a compilation result for this release
 * config.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1.ReleaseConfig.ScheduledReleaseRecord</code>
 */
class ScheduledReleaseRecord extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The timestamp of this release attempt.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp release_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $release_time = null;
    protected $result;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $compilation_result
     *           The name of the created compilation result, if one was successfully
     *           created. Must be in the format
     *           `projects/{@*}locations/{@*}repositories/{@*}compilationResults/*`.
     *     @type \Google\Rpc\Status $error_status
     *           The error status encountered upon this attempt to create the
     *           compilation result, if the attempt was unsuccessful.
     *     @type \Google\Protobuf\Timestamp $release_time
     *           Output only. The timestamp of this release attempt.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the created compilation result, if one was successfully
     * created. Must be in the format
     * `projects/{@*}locations/{@*}repositories/{@*}compilationResults/*`.
     *
     * Generated from protobuf field <code>string compilation_result = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getCompilationResult()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The name of the created compilation result, if one was successfully
     * created. Must be in the format
     * `projects/{@*}locations/{@*}repositories/{@*}compilationResults/*`.
     *
     * Generated from protobuf field <code>string compilation_result = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setCompilationResult($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The error status encountered upon this attempt to create the
     * compilation result, if the attempt was unsuccessful.
     *
     * Generated from protobuf field <code>.google.rpc.Status error_status = 3;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getErrorStatus()
    {
        return $this->readOneof(3);
    }

    public function hasErrorStatus()
    {
        return $this->hasOneof(3);
    }

    /**
     * The error status encountered upon this attempt to create the
     * compilation result, if the attempt was unsuccessful.
     *
     * Generated from protobuf field <code>.google.rpc.Status error_status = 3;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setErrorStatus($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Output only. The timestamp of this release attempt.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp release_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getReleaseTime()
    {
        return $this->release_time;
    }

    public function hasReleaseTime()
    {
        return isset($this->release_time);
    }

    public function clearReleaseTime()
    {
        unset($this->release_time);
    }

    /**
     * Output only. The timestamp of this release attempt.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp release_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setReleaseTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->release_time = $var;

        return $this;
    }

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

}

