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

namespace Google\Cloud\Dataform\V1beta1;

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

/**
 * Represents a single Dataform action in a compilation result.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1beta1.CompilationResultAction</code>
 */
class CompilationResultAction extends \Google\Protobuf\Internal\Message
{
    /**
     * This action's identifier. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target target = 1;</code>
     */
    private $target = null;
    /**
     * The action's identifier if the project had been compiled without any
     * overrides configured. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target canonical_target = 2;</code>
     */
    private $canonical_target = null;
    /**
     * The full path including filename in which this action is located, relative
     * to the workspace root.
     *
     * Generated from protobuf field <code>string file_path = 3;</code>
     */
    private $file_path = '';
    protected $compiled_object;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataform\V1beta1\Target $target
     *           This action's identifier. Unique within the compilation result.
     *     @type \Google\Cloud\Dataform\V1beta1\Target $canonical_target
     *           The action's identifier if the project had been compiled without any
     *           overrides configured. Unique within the compilation result.
     *     @type string $file_path
     *           The full path including filename in which this action is located, relative
     *           to the workspace root.
     *     @type \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation $relation
     *           The database relation created/updated by this action.
     *     @type \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Operations $operations
     *           The database operations executed by this action.
     *     @type \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Assertion $assertion
     *           The assertion executed by this action.
     *     @type \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Declaration $declaration
     *           The declaration declared by this action.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * This action's identifier. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target target = 1;</code>
     * @return \Google\Cloud\Dataform\V1beta1\Target|null
     */
    public function getTarget()
    {
        return $this->target;
    }

    public function hasTarget()
    {
        return isset($this->target);
    }

    public function clearTarget()
    {
        unset($this->target);
    }

    /**
     * This action's identifier. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target target = 1;</code>
     * @param \Google\Cloud\Dataform\V1beta1\Target $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\Target::class);
        $this->target = $var;

        return $this;
    }

    /**
     * The action's identifier if the project had been compiled without any
     * overrides configured. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target canonical_target = 2;</code>
     * @return \Google\Cloud\Dataform\V1beta1\Target|null
     */
    public function getCanonicalTarget()
    {
        return $this->canonical_target;
    }

    public function hasCanonicalTarget()
    {
        return isset($this->canonical_target);
    }

    public function clearCanonicalTarget()
    {
        unset($this->canonical_target);
    }

    /**
     * The action's identifier if the project had been compiled without any
     * overrides configured. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Target canonical_target = 2;</code>
     * @param \Google\Cloud\Dataform\V1beta1\Target $var
     * @return $this
     */
    public function setCanonicalTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\Target::class);
        $this->canonical_target = $var;

        return $this;
    }

    /**
     * The full path including filename in which this action is located, relative
     * to the workspace root.
     *
     * Generated from protobuf field <code>string file_path = 3;</code>
     * @return string
     */
    public function getFilePath()
    {
        return $this->file_path;
    }

    /**
     * The full path including filename in which this action is located, relative
     * to the workspace root.
     *
     * Generated from protobuf field <code>string file_path = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setFilePath($var)
    {
        GPBUtil::checkString($var, True);
        $this->file_path = $var;

        return $this;
    }

    /**
     * The database relation created/updated by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation relation = 4;</code>
     * @return \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation|null
     */
    public function getRelation()
    {
        return $this->readOneof(4);
    }

    public function hasRelation()
    {
        return $this->hasOneof(4);
    }

    /**
     * The database relation created/updated by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation relation = 4;</code>
     * @param \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation $var
     * @return $this
     */
    public function setRelation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * The database operations executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Operations operations = 5;</code>
     * @return \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Operations|null
     */
    public function getOperations()
    {
        return $this->readOneof(5);
    }

    public function hasOperations()
    {
        return $this->hasOneof(5);
    }

    /**
     * The database operations executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Operations operations = 5;</code>
     * @param \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Operations $var
     * @return $this
     */
    public function setOperations($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Operations::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * The assertion executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Assertion assertion = 6;</code>
     * @return \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Assertion|null
     */
    public function getAssertion()
    {
        return $this->readOneof(6);
    }

    public function hasAssertion()
    {
        return $this->hasOneof(6);
    }

    /**
     * The assertion executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Assertion assertion = 6;</code>
     * @param \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Assertion $var
     * @return $this
     */
    public function setAssertion($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Assertion::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * The declaration declared by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Declaration declaration = 7;</code>
     * @return \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Declaration|null
     */
    public function getDeclaration()
    {
        return $this->readOneof(7);
    }

    public function hasDeclaration()
    {
        return $this->hasOneof(7);
    }

    /**
     * The declaration declared by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Declaration declaration = 7;</code>
     * @param \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Declaration $var
     * @return $this
     */
    public function setDeclaration($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Declaration::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

}

