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

namespace Google\Cloud\Support\V2;

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

/**
 * The request message for CreateComment endpoint.
 *
 * Generated from protobuf message <code>google.cloud.support.v2.CreateCommentRequest</code>
 */
class CreateCommentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of Case to which this comment should be added.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The Comment object to be added to this Case.
     *
     * Generated from protobuf field <code>.google.cloud.support.v2.Comment comment = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $comment = null;

    /**
     * @param string                           $parent  Required. The resource name of Case to which this comment should be added. Please see
     *                                                  {@see CommentServiceClient::caseName()} for help formatting this field.
     * @param \Google\Cloud\Support\V2\Comment $comment Required. The Comment object to be added to this Case.
     *
     * @return \Google\Cloud\Support\V2\CreateCommentRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Support\V2\Comment $comment): self
    {
        return (new self())
            ->setParent($parent)
            ->setComment($comment);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The resource name of Case to which this comment should be added.
     *     @type \Google\Cloud\Support\V2\Comment $comment
     *           Required. The Comment object to be added to this Case.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Support\V2\CommentService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of Case to which this comment should be added.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The resource name of Case to which this comment should be added.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The Comment object to be added to this Case.
     *
     * Generated from protobuf field <code>.google.cloud.support.v2.Comment comment = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Support\V2\Comment|null
     */
    public function getComment()
    {
        return $this->comment;
    }

    public function hasComment()
    {
        return isset($this->comment);
    }

    public function clearComment()
    {
        unset($this->comment);
    }

    /**
     * Required. The Comment object to be added to this Case.
     *
     * Generated from protobuf field <code>.google.cloud.support.v2.Comment comment = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Support\V2\Comment $var
     * @return $this
     */
    public function setComment($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Support\V2\Comment::class);
        $this->comment = $var;

        return $this;
    }

}

