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

namespace Google\Cloud\Ces\V1;

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

/**
 * Input for the session.
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.SessionInput</code>
 */
class SessionInput extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. A flag to indicate if the current message is a fragment of a
     * larger input in the bidi streaming session. When `true`, the agent will
     * defer processing until a subsequent message with `will_continue` set to
     * `false` is received.
     * Note: This flag has no effect on audio and DTMF inputs, which are always
     * processed in real-time.
     *
     * Generated from protobuf field <code>bool will_continue = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $will_continue = false;
    protected $input_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Optional. Text data from the end user.
     *     @type string $dtmf
     *           Optional. DTMF digits from the end user.
     *     @type string $audio
     *           Optional. Audio data from the end user.
     *     @type \Google\Cloud\Ces\V1\ToolResponses $tool_responses
     *           Optional. Execution results for the tool calls from the client.
     *     @type \Google\Cloud\Ces\V1\Image $image
     *           Optional. Image data from the end user.
     *     @type \Google\Cloud\Ces\V1\Blob $blob
     *           Optional. Blob data from the end user.
     *     @type \Google\Protobuf\Struct $variables
     *           Optional. Contextual variables for the session, keyed by name. Only
     *           variables declared in the app will be used by the CES agent.
     *           Unrecognized variables will still be sent to the [Dialogflow
     *           agent][Agent.RemoteDialogflowAgent] as additional session parameters.
     *     @type \Google\Cloud\Ces\V1\Event $event
     *           Optional. Event input.
     *     @type bool $will_continue
     *           Optional. A flag to indicate if the current message is a fragment of a
     *           larger input in the bidi streaming session. When `true`, the agent will
     *           defer processing until a subsequent message with `will_continue` set to
     *           `false` is received.
     *           Note: This flag has no effect on audio and DTMF inputs, which are always
     *           processed in real-time.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\SessionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Text data from the end user.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getText()
    {
        return $this->readOneof(1);
    }

    public function hasText()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. Text data from the end user.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. DTMF digits from the end user.
     *
     * Generated from protobuf field <code>string dtmf = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDtmf()
    {
        return $this->readOneof(6);
    }

    public function hasDtmf()
    {
        return $this->hasOneof(6);
    }

    /**
     * Optional. DTMF digits from the end user.
     *
     * Generated from protobuf field <code>string dtmf = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDtmf($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Optional. Audio data from the end user.
     *
     * Generated from protobuf field <code>bytes audio = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAudio()
    {
        return $this->readOneof(2);
    }

    public function hasAudio()
    {
        return $this->hasOneof(2);
    }

    /**
     * Optional. Audio data from the end user.
     *
     * Generated from protobuf field <code>bytes audio = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAudio($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. Execution results for the tool calls from the client.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ToolResponses tool_responses = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ToolResponses|null
     */
    public function getToolResponses()
    {
        return $this->readOneof(3);
    }

    public function hasToolResponses()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. Execution results for the tool calls from the client.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ToolResponses tool_responses = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ToolResponses $var
     * @return $this
     */
    public function setToolResponses($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ToolResponses::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. Image data from the end user.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Image image = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\Image|null
     */
    public function getImage()
    {
        return $this->readOneof(4);
    }

    public function hasImage()
    {
        return $this->hasOneof(4);
    }

    /**
     * Optional. Image data from the end user.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Image image = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\Image $var
     * @return $this
     */
    public function setImage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\Image::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Optional. Blob data from the end user.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Blob blob = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\Blob|null
     */
    public function getBlob()
    {
        return $this->readOneof(7);
    }

    public function hasBlob()
    {
        return $this->hasOneof(7);
    }

    /**
     * Optional. Blob data from the end user.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Blob blob = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\Blob $var
     * @return $this
     */
    public function setBlob($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\Blob::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Optional. Contextual variables for the session, keyed by name. Only
     * variables declared in the app will be used by the CES agent.
     * Unrecognized variables will still be sent to the [Dialogflow
     * agent][Agent.RemoteDialogflowAgent] as additional session parameters.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct variables = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getVariables()
    {
        return $this->readOneof(5);
    }

    public function hasVariables()
    {
        return $this->hasOneof(5);
    }

    /**
     * Optional. Contextual variables for the session, keyed by name. Only
     * variables declared in the app will be used by the CES agent.
     * Unrecognized variables will still be sent to the [Dialogflow
     * agent][Agent.RemoteDialogflowAgent] as additional session parameters.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct variables = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setVariables($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Optional. Event input.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Event event = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\Event|null
     */
    public function getEvent()
    {
        return $this->readOneof(9);
    }

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

    /**
     * Optional. Event input.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.Event event = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\Event $var
     * @return $this
     */
    public function setEvent($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\Event::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Optional. A flag to indicate if the current message is a fragment of a
     * larger input in the bidi streaming session. When `true`, the agent will
     * defer processing until a subsequent message with `will_continue` set to
     * `false` is received.
     * Note: This flag has no effect on audio and DTMF inputs, which are always
     * processed in real-time.
     *
     * Generated from protobuf field <code>bool will_continue = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getWillContinue()
    {
        return $this->will_continue;
    }

    /**
     * Optional. A flag to indicate if the current message is a fragment of a
     * larger input in the bidi streaming session. When `true`, the agent will
     * defer processing until a subsequent message with `will_continue` set to
     * `false` is received.
     * Note: This flag has no effect on audio and DTMF inputs, which are always
     * processed in real-time.
     *
     * Generated from protobuf field <code>bool will_continue = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setWillContinue($var)
    {
        GPBUtil::checkBool($var);
        $this->will_continue = $var;

        return $this;
    }

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

}

