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

namespace Google\Cloud\Dialogflow\Cx\V3;

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

/**
 * Represents session information communicated to and from the webhook.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.SessionInfo</code>
 */
class SessionInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Always present for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for
     * [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The
     * unique identifier of the
     * [session][google.cloud.dialogflow.cx.v3.DetectIntentRequest.session]. This
     * field can be used by the webhook to identify a session.
     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
     * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
     * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`
     * if environment is specified.
     *
     * Generated from protobuf field <code>string session = 1 [(.google.api.resource_reference) = {</code>
     */
    protected $session = '';
    /**
     * Optional for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional
     * for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. All
     * parameters collected from forms and intents during the session. Parameters
     * can be created, updated, or removed by the webhook. To remove a parameter
     * from the session, the webhook should explicitly set the parameter value to
     * null in [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse].
     * The map is keyed by parameters' display names.
     *
     * Generated from protobuf field <code>map<string, .google.protobuf.Value> parameters = 2;</code>
     */
    private $parameters;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $session
     *           Always present for
     *           [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for
     *           [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The
     *           unique identifier of the
     *           [session][google.cloud.dialogflow.cx.v3.DetectIntentRequest.session]. This
     *           field can be used by the webhook to identify a session.
     *           Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
     *           ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
     *           ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`
     *           if environment is specified.
     *     @type array|\Google\Protobuf\Internal\MapField $parameters
     *           Optional for
     *           [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional
     *           for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. All
     *           parameters collected from forms and intents during the session. Parameters
     *           can be created, updated, or removed by the webhook. To remove a parameter
     *           from the session, the webhook should explicitly set the parameter value to
     *           null in [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse].
     *           The map is keyed by parameters' display names.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Webhook::initOnce();
        parent::__construct($data);
    }

    /**
     * Always present for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for
     * [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The
     * unique identifier of the
     * [session][google.cloud.dialogflow.cx.v3.DetectIntentRequest.session]. This
     * field can be used by the webhook to identify a session.
     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
     * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
     * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`
     * if environment is specified.
     *
     * Generated from protobuf field <code>string session = 1 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSession()
    {
        return $this->session;
    }

    /**
     * Always present for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for
     * [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The
     * unique identifier of the
     * [session][google.cloud.dialogflow.cx.v3.DetectIntentRequest.session]. This
     * field can be used by the webhook to identify a session.
     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
     * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
     * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`
     * if environment is specified.
     *
     * Generated from protobuf field <code>string session = 1 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSession($var)
    {
        GPBUtil::checkString($var, True);
        $this->session = $var;

        return $this;
    }

    /**
     * Optional for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional
     * for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. All
     * parameters collected from forms and intents during the session. Parameters
     * can be created, updated, or removed by the webhook. To remove a parameter
     * from the session, the webhook should explicitly set the parameter value to
     * null in [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse].
     * The map is keyed by parameters' display names.
     *
     * Generated from protobuf field <code>map<string, .google.protobuf.Value> parameters = 2;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    /**
     * Optional for
     * [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional
     * for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. All
     * parameters collected from forms and intents during the session. Parameters
     * can be created, updated, or removed by the webhook. To remove a parameter
     * from the session, the webhook should explicitly set the parameter value to
     * null in [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse].
     * The map is keyed by parameters' display names.
     *
     * Generated from protobuf field <code>map<string, .google.protobuf.Value> parameters = 2;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setParameters($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
        $this->parameters = $arr;

        return $this;
    }

}

