diff --git a/src/Socialbox/Objects/Standard/EncryptionChannelMessage.php b/src/Socialbox/Objects/Standard/EncryptionChannelMessage.php new file mode 100644 index 0000000..031d78e --- /dev/null +++ b/src/Socialbox/Objects/Standard/EncryptionChannelMessage.php @@ -0,0 +1,79 @@ +messageUuid = $data['message_uuid']; + $this->channelUuid = $data['channel_uuid']; + $this->status = EncryptionChannelStatus::from($data['status']); + $this->hash = $data['hash']; + $this->data = $data['data']; + $this->timestamp = $data['timestamp']; + } + + public function getMessageUuid(): string + { + return $this->messageUuid; + } + + public function getChannelUuid(): string + { + return $this->channelUuid; + } + + public function getStatus(): EncryptionChannelStatus + { + return $this->status; + } + + public function getHash(): string + { + return $this->hash; + } + + public function getData(): string + { + return $this->data; + } + + public function getTimestamp(): int + { + return $this->timestamp; + } + + /** + * @inheritDoc + */ + public static function fromArray(array $data): EncryptionChannelMessage + { + return new self($data); + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'message_uuid' => $this->messageUuid, + 'channel_uuid' => $this->channelUuid, + 'status' => $this->status->value, + 'hash' => $this->hash, + 'data' => $this->data, + 'timestamp' => $this->timestamp + ]; + } + } \ No newline at end of file