public function getEmbeddedMessage(): EmbeddedMessageInterface
    {
        if (!$this->isEmbeddedMessage()) {
            throw new NotEmbeddedMessageException(\sprintf(
                'Attachment "%s" in message "%s" is not embedded message',
                $this->getPartNumber(),
                $this->getNumber()
            ));
        }

        return new EmbeddedMessage($this->resource, $this->getNumber(), $this->getPartNumber(), $this->getStructure()->parts[0]);
    }
public function getEmbeddedMessage(): EmbeddedMessageInterface
    {
        if (!$this->isEmbeddedMessage()) {
            throw new NotEmbeddedMessageException(\sprintf(
                'Attachment "%s" in message "%s" is not embedded message',
                $this->getPartNumber(),
                $this->getNumber()
            ));
        }

        return new EmbeddedMessage($this->resource, $this->getNumber(), $this->getPartNumber(), $this->getStructure()->parts[0]);
    }
public function getEmbeddedMessage ( ) : EmbeddedMessageInterface { if ( ! $ this -> isEmbeddedMessage ( ) ) { throw new NotEmbeddedMessageException ( \ sprintf ( 'Attachment "%s" in message "%s" is not embedded message' , $ this -> getPartNumber ( ) , $ this -> getNumber ( ) ) ) ; } return new EmbeddedMessage ( $ this -> resource , $ this -> getNumber ( ) , $ this -> getPartNumber ( ) , $ this -> getStructure ( ) -> parts [ 0 ] ) ; }
Return embedded message.

@throws NotEmbeddedMessageException

@return EmbeddedMessageInterface
Return embedded message .