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

namespace Google\Cloud\Dataform\V1;

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

/**
 * Represents a single Dataform action in a compilation result.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1.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.v1.Target target = 1;</code>
     */
    protected $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.v1.Target canonical_target = 2;</code>
     */
    protected $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>
     */
    protected $file_path = '';
    /**
     * Output only. All the metadata information that is used internally to serve
     * the resource. For example: timestamps, flags, status fields, etc. The
     * format of this field is a JSON string.
     *
     * Generated from protobuf field <code>optional string internal_metadata = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $internal_metadata = null;
    protected $compiled_object;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\Relation $relation
     *           The database relation created/updated by this action.
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\Operations $operations
     *           The database operations executed by this action.
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\Assertion $assertion
     *           The assertion executed by this action.
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\Declaration $declaration
     *           The declaration declared by this action.
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\Notebook $notebook
     *           The notebook executed by this action.
     *     @type \Google\Cloud\Dataform\V1\CompilationResultAction\DataPreparation $data_preparation
     *           The data preparation executed by this action.
     *     @type \Google\Cloud\Dataform\V1\Target $target
     *           This action's identifier. Unique within the compilation result.
     *     @type \Google\Cloud\Dataform\V1\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 string $internal_metadata
     *           Output only. All the metadata information that is used internally to serve
     *           the resource. For example: timestamps, flags, status fields, etc. The
     *           format of this field is a JSON string.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1\Dataform::initOnce();
        parent::__construct($data);
    }

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

        return $this;
    }

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

        return $this;
    }

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

        return $this;
    }

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

        return $this;
    }

    /**
     * The notebook executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.CompilationResultAction.Notebook notebook = 8;</code>
     * @return \Google\Cloud\Dataform\V1\CompilationResultAction\Notebook|null
     */
    public function getNotebook()
    {
        return $this->readOneof(8);
    }

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

    /**
     * The notebook executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.CompilationResultAction.Notebook notebook = 8;</code>
     * @param \Google\Cloud\Dataform\V1\CompilationResultAction\Notebook $var
     * @return $this
     */
    public function setNotebook($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1\CompilationResultAction\Notebook::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * The data preparation executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.CompilationResultAction.DataPreparation data_preparation = 9;</code>
     * @return \Google\Cloud\Dataform\V1\CompilationResultAction\DataPreparation|null
     */
    public function getDataPreparation()
    {
        return $this->readOneof(9);
    }

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

    /**
     * The data preparation executed by this action.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.CompilationResultAction.DataPreparation data_preparation = 9;</code>
     * @param \Google\Cloud\Dataform\V1\CompilationResultAction\DataPreparation $var
     * @return $this
     */
    public function setDataPreparation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1\CompilationResultAction\DataPreparation::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * This action's identifier. Unique within the compilation result.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.Target target = 1;</code>
     * @return \Google\Cloud\Dataform\V1\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.v1.Target target = 1;</code>
     * @param \Google\Cloud\Dataform\V1\Target $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1\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.v1.Target canonical_target = 2;</code>
     * @return \Google\Cloud\Dataform\V1\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.v1.Target canonical_target = 2;</code>
     * @param \Google\Cloud\Dataform\V1\Target $var
     * @return $this
     */
    public function setCanonicalTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1\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;
    }

    /**
     * Output only. All the metadata information that is used internally to serve
     * the resource. For example: timestamps, flags, status fields, etc. The
     * format of this field is a JSON string.
     *
     * Generated from protobuf field <code>optional string internal_metadata = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getInternalMetadata()
    {
        return isset($this->internal_metadata) ? $this->internal_metadata : '';
    }

    public function hasInternalMetadata()
    {
        return isset($this->internal_metadata);
    }

    public function clearInternalMetadata()
    {
        unset($this->internal_metadata);
    }

    /**
     * Output only. All the metadata information that is used internally to serve
     * the resource. For example: timestamps, flags, status fields, etc. The
     * format of this field is a JSON string.
     *
     * Generated from protobuf field <code>optional string internal_metadata = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setInternalMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->internal_metadata = $var;

        return $this;
    }

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

}

