google.cloud.dialogflow.v2.Message */ class Message extends \Google\Protobuf\Internal\Message { /** * Optional. The unique identifier of the message. * Format: `projects//locations//conversations//messages/`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ protected $name = ''; /** * Required. The message content. * * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $content = ''; /** * Optional. The message language. * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) * language tag. Example: "en-US". * * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; */ protected $language_code = ''; /** * Output only. The participant that sends this message. * * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $participant = ''; /** * Output only. The role of the participant. * * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $participant_role = 0; /** * Output only. The time when the message was created in Contact Center AI. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $create_time = null; /** * Optional. The time when the message was sent. For voice messages, this is * the time when an utterance started. * * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; */ protected $send_time = null; /** * Output only. The annotation for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $message_annotation = null; /** * Output only. The sentiment analysis result for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $sentiment_analysis = null; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * Optional. The unique identifier of the message. * Format: `projects//locations//conversations//messages/`. * @type string $content * Required. The message content. * @type string $language_code * Optional. The message language. * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) * language tag. Example: "en-US". * @type string $participant * Output only. The participant that sends this message. * @type int $participant_role * Output only. The role of the participant. * @type \Google\Protobuf\Timestamp $create_time * Output only. The time when the message was created in Contact Center AI. * @type \Google\Protobuf\Timestamp $send_time * Optional. The time when the message was sent. For voice messages, this is * the time when an utterance started. * @type \Google\Cloud\Dialogflow\V2\MessageAnnotation $message_annotation * Output only. The annotation for the message. * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $sentiment_analysis * Output only. The sentiment analysis result for the message. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); parent::__construct($data); } /** * Optional. The unique identifier of the message. * Format: `projects//locations//conversations//messages/`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getName() { return $this->name; } /** * Optional. The unique identifier of the message. * Format: `projects//locations//conversations//messages/`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } /** * Required. The message content. * * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getContent() { return $this->content; } /** * Required. The message content. * * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ public function setContent($var) { GPBUtil::checkString($var, True); $this->content = $var; return $this; } /** * Optional. The message language. * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) * language tag. Example: "en-US". * * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getLanguageCode() { return $this->language_code; } /** * Optional. The message language. * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) * language tag. Example: "en-US". * * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ public function setLanguageCode($var) { GPBUtil::checkString($var, True); $this->language_code = $var; return $this; } /** * Output only. The participant that sends this message. * * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string */ public function getParticipant() { return $this->participant; } /** * Output only. The participant that sends this message. * * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var * @return $this */ public function setParticipant($var) { GPBUtil::checkString($var, True); $this->participant = $var; return $this; } /** * Output only. The role of the participant. * * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int */ public function getParticipantRole() { return $this->participant_role; } /** * Output only. The role of the participant. * * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var * @return $this */ public function setParticipantRole($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); $this->participant_role = $var; return $this; } /** * Output only. The time when the message was created in Contact Center AI. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Timestamp|null */ public function getCreateTime() { return $this->create_time; } public function hasCreateTime() { return isset($this->create_time); } public function clearCreateTime() { unset($this->create_time); } /** * Output only. The time when the message was created in Contact Center AI. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Protobuf\Timestamp $var * @return $this */ public function setCreateTime($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->create_time = $var; return $this; } /** * Optional. The time when the message was sent. For voice messages, this is * the time when an utterance started. * * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Timestamp|null */ public function getSendTime() { return $this->send_time; } public function hasSendTime() { return isset($this->send_time); } public function clearSendTime() { unset($this->send_time); } /** * Optional. The time when the message was sent. For voice messages, this is * the time when an utterance started. * * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Protobuf\Timestamp $var * @return $this */ public function setSendTime($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->send_time = $var; return $this; } /** * Output only. The annotation for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\Dialogflow\V2\MessageAnnotation|null */ public function getMessageAnnotation() { return $this->message_annotation; } public function hasMessageAnnotation() { return isset($this->message_annotation); } public function clearMessageAnnotation() { unset($this->message_annotation); } /** * Output only. The annotation for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\Dialogflow\V2\MessageAnnotation $var * @return $this */ public function setMessageAnnotation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\MessageAnnotation::class); $this->message_annotation = $var; return $this; } /** * Output only. The sentiment analysis result for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult|null */ public function getSentimentAnalysis() { return $this->sentiment_analysis; } public function hasSentimentAnalysis() { return isset($this->sentiment_analysis); } public function clearSentimentAnalysis() { unset($this->sentiment_analysis); } /** * Output only. The sentiment analysis result for the message. * * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $var * @return $this */ public function setSentimentAnalysis($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult::class); $this->sentiment_analysis = $var; return $this; } }