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

namespace Google\Cloud\Dialogflow\V2\Conversation\ContextReference;

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

/**
 * Contents ingested.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent</code>
 */
class ContextContent extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The information ingested in a single request.
     *
     * Generated from protobuf field <code>string content = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $content = '';
    /**
     * Required. The format of the ingested string.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $content_format = 0;
    /**
     * Output only. The time when this information was incorporated into the
     * relevant context reference.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $ingestion_time = null;
    /**
     * If the context content was generated from a tool call, specify the
     * answer record associated with the tool call.
     * Format: `projects/<Project ID>/locations/<Location
     * ID>/answerRecords/<Answer Record ID>`.
     *
     * Generated from protobuf field <code>string answer_record = 4;</code>
     */
    protected $answer_record = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $content
     *           Required. The information ingested in a single request.
     *     @type int $content_format
     *           Required. The format of the ingested string.
     *     @type \Google\Protobuf\Timestamp $ingestion_time
     *           Output only. The time when this information was incorporated into the
     *           relevant context reference.
     *     @type string $answer_record
     *           If the context content was generated from a tool call, specify the
     *           answer record associated with the tool call.
     *           Format: `projects/<Project ID>/locations/<Location
     *           ID>/answerRecords/<Answer Record ID>`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The information ingested in a single request.
     *
     * Generated from protobuf field <code>string content = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Required. The information ingested in a single request.
     *
     * Generated from protobuf field <code>string content = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->content = $var;

        return $this;
    }

    /**
     * Required. The format of the ingested string.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getContentFormat()
    {
        return $this->content_format;
    }

    /**
     * Required. The format of the ingested string.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setContentFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent\ContentFormat::class);
        $this->content_format = $var;

        return $this;
    }

    /**
     * Output only. The time when this information was incorporated into the
     * relevant context reference.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getIngestionTime()
    {
        return $this->ingestion_time;
    }

    public function hasIngestionTime()
    {
        return isset($this->ingestion_time);
    }

    public function clearIngestionTime()
    {
        unset($this->ingestion_time);
    }

    /**
     * Output only. The time when this information was incorporated into the
     * relevant context reference.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setIngestionTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->ingestion_time = $var;

        return $this;
    }

    /**
     * If the context content was generated from a tool call, specify the
     * answer record associated with the tool call.
     * Format: `projects/<Project ID>/locations/<Location
     * ID>/answerRecords/<Answer Record ID>`.
     *
     * Generated from protobuf field <code>string answer_record = 4;</code>
     * @return string
     */
    public function getAnswerRecord()
    {
        return $this->answer_record;
    }

    /**
     * If the context content was generated from a tool call, specify the
     * answer record associated with the tool call.
     * Format: `projects/<Project ID>/locations/<Location
     * ID>/answerRecords/<Answer Record ID>`.
     *
     * Generated from protobuf field <code>string answer_record = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAnswerRecord($var)
    {
        GPBUtil::checkString($var, True);
        $this->answer_record = $var;

        return $this;
    }

}


