<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/cx/v3/webhook.proto

namespace Google\Cloud\Dialogflow\Cx\V3\WebhookResponse;

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

/**
 * Represents a fulfillment response to the user.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse</code>
 */
class FulfillmentResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The list of rich message responses to present to the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.ResponseMessage messages = 1;</code>
     */
    private $messages;
    /**
     * Merge behavior for `messages`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;</code>
     */
    protected $merge_behavior = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Dialogflow\Cx\V3\ResponseMessage>|\Google\Protobuf\Internal\RepeatedField $messages
     *           The list of rich message responses to present to the user.
     *     @type int $merge_behavior
     *           Merge behavior for `messages`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Webhook::initOnce();
        parent::__construct($data);
    }

    /**
     * The list of rich message responses to present to the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.ResponseMessage messages = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMessages()
    {
        return $this->messages;
    }

    /**
     * The list of rich message responses to present to the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.ResponseMessage messages = 1;</code>
     * @param array<\Google\Cloud\Dialogflow\Cx\V3\ResponseMessage>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\Cx\V3\ResponseMessage::class);
        $this->messages = $arr;

        return $this;
    }

    /**
     * Merge behavior for `messages`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;</code>
     * @return int
     */
    public function getMergeBehavior()
    {
        return $this->merge_behavior;
    }

    /**
     * Merge behavior for `messages`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setMergeBehavior($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\Cx\V3\WebhookResponse\FulfillmentResponse\MergeBehavior::class);
        $this->merge_behavior = $var;

        return $this;
    }

}


