<?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 Dataform Git commit.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1beta1.CommitMetadata</code>
 */
class CommitMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The commit's author.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CommitAuthor author = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $author = null;
    /**
     * Optional. The commit's message.
     *
     * Generated from protobuf field <code>string commit_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $commit_message = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataform\V1beta1\CommitAuthor $author
     *           Required. The commit's author.
     *     @type string $commit_message
     *           Optional. The commit's message.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The commit's author.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CommitAuthor author = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Dataform\V1beta1\CommitAuthor|null
     */
    public function getAuthor()
    {
        return $this->author;
    }

    public function hasAuthor()
    {
        return isset($this->author);
    }

    public function clearAuthor()
    {
        unset($this->author);
    }

    /**
     * Required. The commit's author.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CommitAuthor author = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Dataform\V1beta1\CommitAuthor $var
     * @return $this
     */
    public function setAuthor($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CommitAuthor::class);
        $this->author = $var;

        return $this;
    }

    /**
     * Optional. The commit's message.
     *
     * Generated from protobuf field <code>string commit_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getCommitMessage()
    {
        return $this->commit_message;
    }

    /**
     * Optional. The commit's message.
     *
     * Generated from protobuf field <code>string commit_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setCommitMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->commit_message = $var;

        return $this;
    }

}

