codecov[bot]: # [Codecov](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=h1) Report
> Merging [#125](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=desc) into [master](https://codecov.io/gh/Stranger6667/postmarker/commit/604005f5a384995207ffb53e6de2b8f3fa2b38db?src=pr&el=desc) will **decrease** coverage by `0.12%`.
> The diff coverage is `87.5%`.

[![Impacted file tree graph](https://codecov.io/gh/Stranger6667/postmarker/pull/125/graphs/tree.svg?height=150&width=650&token=ntmpbnZMPl&src=pr)](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
- Coverage     100%   99.87%   -0.13%     
==========================================
  Files          20       20              
  Lines         788      790       +2     
  Branches       61       61              
==========================================
+ Hits          788      789       +1     
- Misses          0        1       +1
```


| [Impacted Files](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [postmarker/models/messages.py](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=tree#diff-cG9zdG1hcmtlci9tb2RlbHMvbWVzc2FnZXMucHk=) | `98.93% <87.5%> (-1.07%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=footer). Last update [604005f...8c2bf75](https://codecov.io/gh/Stranger6667/postmarker/pull/125?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 2ab7edc..208173f 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -11,6 +11,12 @@ Added
 
 - Short-circuit send of empty batches in `Django` backend. `#123`_
 
+Changed
+~~~~~~~
+
+- ``OutboundMessageManager.get_details`` and ``InboundMessageManager.get_details`` were methods were renamed to ``get``.
+  Now they returns ``OutboundMessage`` and ``InboundMessage`` instances respectively.
+
 `0.9.2`_ - 2017-03-29
 ---------------------
 
diff --git a/postmarker/models/messages.py b/postmarker/models/messages.py
index 6e946a0..361515f 100644
--- a/postmarker/models/messages.py
+++ b/postmarker/models/messages.py
@@ -35,8 +35,8 @@ class OpensManager(ModelManager):
 
 class BaseMessage(Model):
 
-    def get_details(self):
-        return self._manager.get_details(self.MessageID)
+    def get(self):
+        return self._manager.get(self.MessageID)
 
 
 class OutboundMessage(BaseMessage):
@@ -82,8 +82,9 @@ class OutboundMessageManager(SubModelManager):
         )
         return self.expand_responses(responses, 'Messages')
 
-    def get_details(self, id):
-        return self.call('GET', '/messages/outbound/%s/details' % id)
+    def get(self, id):
+        response = self.call('GET', '/messages/outbound/%s/details' % id)
+        return self._init_instance(response)
 
     def get_dump(self, id):
         return self.call('GET', '/messages/outbound/%s/dump' % id).get('Body')
@@ -169,8 +170,9 @@ class InboundMessageManager(ModelManager):
         )
         return self.expand_responses(responses, 'InboundMessages')
 
-    def get_details(self, id):
-        return self.call('GET', '/messages/inbound/%s/details' % id)
+    def get(self, id):
+        response = self.call('GET', '/messages/inbound/%s/details' % id)
+        return self._init_instance(response)
 
     def bypass(self, id):
         return self.call('PUT', '/messages/inbound/%s/bypass' % id)

Initialize inbound/outbound message in `get_details`
And probably rename method to ``get``
diff --git a/tests/models/test_messages.py b/tests/models/test_messages.py
index 412296f..7910fb7 100644
--- a/tests/models/test_messages.py
+++ b/tests/models/test_messages.py
@@ -8,6 +8,8 @@ from postmarker.exceptions import ClientError
 from postmarker.models.base import ModelManager
 from postmarker.models.messages import Attachment, InboundMessage, Open, OutboundMessage
 
+from .._compat import patch
+
 
 CASSETTE_NAME = 'messages'
 
@@ -39,8 +41,8 @@ class TestOutboundMessages:
         assert isinstance(outbound_message, OutboundMessage)
         assert str(outbound_message) == 'Sent message to test@example.com'
 
-    def test_get_details(self, outbound_message):
-        assert outbound_message.get_details()['Body'] == 'Body example'
+    def test_get(self, outbound_message):
+        assert outbound_message.get().Body == 'Body example'
 
     def test_get_dump(self, outbound_message):
         assert outbound_message.get_dump() == 'Body example'
@@ -60,9 +62,10 @@ class TestInboundMessages:
         assert isinstance(inbound_message, InboundMessage)
         assert str(inbound_message) == 'Blocked message from test@example.com'
 
-    def test_get_details(self, inbound_message):
-        with not_found():
-            inbound_message.get_details()
+    def test_get(self, inbound_message):
+        with patch.object(inbound_message._manager, 'call', return_value=inbound_message.as_dict()):
+            instance = inbound_message.get()
+        assert isinstance(instance, InboundMessage)
 
     def test_bypass(self, inbound_message):
         with not_found('[701] This message was not found or cannot be bypassed.'):

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-django betamax betamax_serializers mock
3.6
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
betamax==0.8.1
betamax-serializers==0.2.1
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
docutils==0.18.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mock==5.2.0
packaging==21.3
pluggy==1.0.0
-e git+https://github.com/Stranger6667/postmarker.git@604005f5a384995207ffb53e6de2b8f3fa2b38db#egg=postmarker
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
pytest-django==4.5.2
pytz==2025.2
requests==2.27.1
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==0.1.9
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: postmarker
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - betamax==0.8.1
      - betamax-serializers==0.2.1
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mock==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-django==4.5.2
      - pytz==2025.2
      - requests==2.27.1
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==0.1.9
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/postmarker

tests/models/test_messages.py::TestOutboundMessages::test_get tests/models/test_messages.py::TestInboundMessages::test_get
tests/models/test_messages.py::test_sub_managers tests/models/test_messages.py::TestOutboundMessages::test_message tests/models/test_messages.py::TestOutboundMessages::test_get_dump tests/models/test_messages.py::TestOutboundMessages::test_opens tests/models/test_messages.py::TestInboundMessages::test_message tests/models/test_messages.py::TestInboundMessages::test_bypass tests/models/test_messages.py::TestInboundMessages::test_retry tests/models/test_messages.py::TestInboundMessages::test_all tests/models/test_messages.py::TestInboundMessages::test_headers tests/models/test_messages.py::TestInboundMessages::test_not_existing_header tests/models/test_messages.py::TestAttachment::test_instance tests/models/test_messages.py::TestAttachment::test_repr tests/models/test_messages.py::TestAttachment::test_len tests/models/test_messages.py::TestAttachment::test_attributes[ContentType] tests/models/test_messages.py::TestAttachment::test_attributes[Name] tests/models/test_messages.py::TestAttachment::test_attributes[ContentLength] tests/models/test_messages.py::TestAttachment::test_attributes[Content] tests/models/test_messages.py::TestAttachment::test_save tests/models/test_messages.py::TestAttachment::test_as_mime tests/models/test_messages.py::TestOpens::test_model tests/models/test_messages.py::TestOpens::test_webhook
docs/changelog.rst postmarker/models/messages.py
docs/changelog.rst postmarker/models/messages.py