src/RichMessage/Text.php
protected function renderV2()
    {
        if ('google' == $this->requestSource) {
            $out = [
                'platform'        => 'ACTIONS_ON_GOOGLE',
                'simpleResponses' => [
                    'simpleResponses' => [],
                ],
            ];

            if ($this->ssml) {
                $out['simpleResponses']['simpleResponses'][0]['ssml'] = $this->ssml;
            } else {
                $out['simpleResponses']['simpleResponses'][0]['textToSpeech'] = $this->text;
            }

            $out['simpleResponses']['simpleResponses'][0]['displayText'] = $this->text;

            return $out;
        } else {
            $out = [
                'text' => [
                    'text' => [$this->text],
                ],
            ];

            if (in_array($this->requestSource, $this->supportedRichMessagePlatforms)) {
                $out['platform'] = $this->v2PlatformMap[$this->requestSource];
            }

            return $out;
        }
    }
protected function renderV2()
    {
        if ('google' == $this->requestSource) {
            $out = [
                'platform'        => 'ACTIONS_ON_GOOGLE',
                'simpleResponses' => [
                    'simpleResponses' => [],
                ],
            ];

            if ($this->ssml) {
                $out['simpleResponses']['simpleResponses'][0]['ssml'] = $this->ssml;
            } else {
                $out['simpleResponses']['simpleResponses'][0]['textToSpeech'] = $this->text;
            }

            $out['simpleResponses']['simpleResponses'][0]['displayText'] = $this->text;

            return $out;
        } else {
            $out = [
                'text' => [
                    'text' => [$this->text],
                ],
            ];

            if (in_array($this->requestSource, $this->supportedRichMessagePlatforms)) {
                $out['platform'] = $this->v2PlatformMap[$this->requestSource];
            }

            return $out;
        }
    }
Render response as array for API V2.

@return array