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

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * Multi-modal content.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.AssistantContent</code>
 */
class AssistantContent extends \Google\Protobuf\Internal\Message
{
    /**
     * The producer of the content. Can be "model" or "user".
     *
     * Generated from protobuf field <code>string role = 1;</code>
     */
    protected $role = '';
    /**
     * Optional. Indicates if the part is thought from the model.
     *
     * Generated from protobuf field <code>bool thought = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $thought = false;
    protected $data;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Inline text.
     *     @type \Google\Cloud\DiscoveryEngine\V1\AssistantContent\Blob $inline_data
     *           Inline binary data.
     *     @type \Google\Cloud\DiscoveryEngine\V1\AssistantContent\File $file
     *           A file, e.g., an audio summary.
     *     @type \Google\Cloud\DiscoveryEngine\V1\AssistantContent\ExecutableCode $executable_code
     *           Code generated by the model that is meant to be executed.
     *     @type \Google\Cloud\DiscoveryEngine\V1\AssistantContent\CodeExecutionResult $code_execution_result
     *           Result of executing an ExecutableCode.
     *     @type string $role
     *           The producer of the content. Can be "model" or "user".
     *     @type bool $thought
     *           Optional. Indicates if the part is thought from the model.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\AssistAnswer::initOnce();
        parent::__construct($data);
    }

    /**
     * Inline text.
     *
     * Generated from protobuf field <code>string text = 2;</code>
     * @return string
     */
    public function getText()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Inline text.
     *
     * Generated from protobuf field <code>string text = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Inline binary data.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.Blob inline_data = 3;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\AssistantContent\Blob|null
     */
    public function getInlineData()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Inline binary data.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.Blob inline_data = 3;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\AssistantContent\Blob $var
     * @return $this
     */
    public function setInlineData($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AssistantContent\Blob::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * A file, e.g., an audio summary.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.File file = 4;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\AssistantContent\File|null
     */
    public function getFile()
    {
        return $this->readOneof(4);
    }

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

    /**
     * A file, e.g., an audio summary.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.File file = 4;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\AssistantContent\File $var
     * @return $this
     */
    public function setFile($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AssistantContent\File::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Code generated by the model that is meant to be executed.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.ExecutableCode executable_code = 7;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\AssistantContent\ExecutableCode|null
     */
    public function getExecutableCode()
    {
        return $this->readOneof(7);
    }

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

    /**
     * Code generated by the model that is meant to be executed.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.ExecutableCode executable_code = 7;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\AssistantContent\ExecutableCode $var
     * @return $this
     */
    public function setExecutableCode($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AssistantContent\ExecutableCode::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Result of executing an ExecutableCode.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult code_execution_result = 8;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\AssistantContent\CodeExecutionResult|null
     */
    public function getCodeExecutionResult()
    {
        return $this->readOneof(8);
    }

    public function hasCodeExecutionResult()
    {
        return $this->hasOneof(8);
    }

    /**
     * Result of executing an ExecutableCode.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult code_execution_result = 8;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\AssistantContent\CodeExecutionResult $var
     * @return $this
     */
    public function setCodeExecutionResult($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AssistantContent\CodeExecutionResult::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * The producer of the content. Can be "model" or "user".
     *
     * Generated from protobuf field <code>string role = 1;</code>
     * @return string
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * The producer of the content. Can be "model" or "user".
     *
     * Generated from protobuf field <code>string role = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setRole($var)
    {
        GPBUtil::checkString($var, True);
        $this->role = $var;

        return $this;
    }

    /**
     * Optional. Indicates if the part is thought from the model.
     *
     * Generated from protobuf field <code>bool thought = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getThought()
    {
        return $this->thought;
    }

    /**
     * Optional. Indicates if the part is thought from the model.
     *
     * Generated from protobuf field <code>bool thought = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setThought($var)
    {
        GPBUtil::checkBool($var);
        $this->thought = $var;

        return $this;
    }

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

}

