@param ArticlePostMessage $message

@return Article
359745
public function postArticle(ArticlePostMessage $message): Article
    {
        $path = sprintf('sites/%d/articles', $message->getSiteId());
        $data = ['api_article' => $message->build()];

        $response = $this->getClient()->sendRequest(RequestStatus::POST, $path, $data);

        /** @var Article $model */
        $model = $this->getModelFactory()->create(Article::class, $response);

        return $model;
    }
1105573
public function translate($message)
    {
        // message must be an array
        if (!is_array($message)) {
            return null;
        }

        // we must have an event property
        if (!isset($message['event'])) {
            return null;
        }

        // don't include the event name as an attribute
        $attributes = $message;
        unset($attributes['event']);

        return new SimpleEvent($message['event'], $attributes);
    }
812380
public function sendMessage(string $message) : ?Message 
    {
        $data = (object)[
            'messageEventDetail' => (object)[
                'eventCategoryCode' => MessageType::Text, 
                'messageDetail' => (object)[
                    'body' => $message
                ]
            ]
        ];

        $parameters = [
            [
                'name' => 'messageEventDetail',
                'contents' => json_encode($data, JSON_PRETTY_PRINT),
                'headers' => [
                    'Content-Type' => 'application/json; charset=utf-8'
                ]
            ]
        ];

        $response = $this->postMultiPart(sprintf(MessageThread::MESSAGE_THREAD_ENDPOINT . 'threads/%s/messages', $this->messageThreadId), $parameters);

        $messageFields = $this->info(1, true);

        if (!isset($messageFields->threadEvents)) return null;

        $messageData = $messageFields->threadEvents[0];

        return new Message($this->client, $messageData->messageEventDetail, $this);
    }
922156
public function transformMaterial(AbstractMessage $message)
    {
        $type = $message->getType();

        return [
            'msgtype' => $type,
            $type     => [
                'media_id' => $message->get('media_id'),
            ],
        ];
    }
163434
public function addMessage($message) {
        $this->message = trim(trim($this->message).NL.$message);
        return $this;
    }
1274527
public function page(array $message) {
    $message = $this->message($message, "properties");
    $message["type"] = "page";

    return $this->consumer->page($message);
  }
1324229
public function message($message)
    {
        if (is_string($message)) {
            $message = new Text($message);
        }

        $this->message = $message;

        return $this;
    }
275865
public function postCallTracking(CallTrackingPostMessage $message): CallTracking
    {
        $path = sprintf('sites/%d/call_trackings', $message->getSiteId());
        $data = ['api_call_tracking' => $message->build()];

        $response = $this->getClient()->sendRequest('POST', $path, $data);

        /** @var CallTracking $model */
        $model = $this->getModelFactory()->create(CallTracking::class, $response);

        return $model;
    }
1123772
public function postCategory(CategoryPostMessage $message): Category
    {
        $path = sprintf('sites/%d/categories', $message->getSiteId());
        $data = ['api_category' => $message->build()];

        $response = $this->getClient()->sendRequest(RequestStatus::POST, $path, $data);

        /** @var Category $model */
        $model = $this->getModelFactory()->create(Category::class, $response);

        return $model;
    }
458252
public function save(Message $message) : ?Message
    {
        /** @var AggregateRepository $repository */
        $repository = $message->getHeaders()->get(CqrsMessagingModule::INTEGRATION_MESSAGING_CQRS_AGGREGATE_REPOSITORY_HEADER);

        $aggregate = $message->getHeaders()->get(CqrsMessagingModule::INTEGRATION_MESSAGING_CQRS_AGGREGATE_HEADER);

        $repository->save($aggregate);

        return $message;
    }
950340
public function setMessage($message)
    {
        if ( ! is_null($message)) $message = (string) $message;

        $this->setAttribute('message', $message);

        return $this;
    }
181481
public function translate($message)
    {
        // message must be an array
        if (!is_array($message)) {
            return null;
        }

        // the following keys are required to construct a topic event object
        $keys = ['topic', 'event', 'version'];
        foreach ($keys as $k) {
            if (!isset($message[$k])) {
                return null;
            }
        }

        // don't include the topic, event and version as attributes
        $attributes = $message;
        unset($attributes['topic'], $attributes['event'], $attributes['version']);

        return new TopicEvent($message['topic'], $message['event'], $message['version'], $attributes);
    }
1043772
public function fromMessage($message)
    {
        static $parser;
        if (!$parser) {
            $parser = new MessageParser();
        }

        // Parse a response
        if (strtoupper(substr($message, 0, 4)) == 'HTTP') {
            $data = $parser->parseResponse($message);
            return $this->createResponse(
                $data['code'],
                $data['headers'],
                $data['body'] === '' ? null : $data['body'],
                $data
            );
        }

        // Parse a request
        if (!($data = ($parser->parseRequest($message)))) {
            throw new \InvalidArgumentException('Unable to parse request');
        }

        return $this->createRequest(
            $data['method'],
            Url::buildUrl($data['request_url']),
            [
                'headers' => $data['headers'],
                'body' => $data['body'] === '' ? null : $data['body'],
                'config' => [
                    'protocol_version' => $data['protocol_version']
                ]
            ]
        );
    }
1237034
public function comment(string $message) : ?Comment
    {
        $comment = $this->postJson(sprintf(self::ACTIVITY_ENDPOINT . 'v1/users/me/comment/%s', $this->storyId()), [
            'commentString' => $message
        ]);

        // Since I couldn't find an endpoint that gave me a comment's info using just it's comment id, let's just grab the newest comment.
        $newest = $this->comments(0, 1, 'ASC');

        if (count($newest) === 0) return null;
        
        return $newest[0];
    }
1042260
public function addMessage(Message $message)
    {
        $type = $message->getType();
        if (!array_key_exists($type, $this->messages)) {
            $this->messages[$type] = [];
        }

        if ($message->getId() !== null) {
            $this->messages[$type][$message->getId()] = $message;
        } else {
            $this->messages[$type][] = $message;
        }

        return $this;
    }
612429
public function getMessage($message = "codeco")
    {
        $folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
        return $folder.SEPARATOR.strtolower($message).".xml";
    }
712036
public function trans( $message ) {
		$theme  = wp_get_theme();
		$domain = $theme->get( 'TextDomain' );
		return __( $message, $domain );
	}