From 0ee5f875a480f5fcb42b2cffc7d7a9c5055b3f49 Mon Sep 17 00:00:00 2001 From: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com> Date: Thu, 7 Jul 2022 21:28:15 -0400 Subject: [PATCH] Add `metadata` field to `JobStatus` --- CHANGELOG.md | 4 ++++ nylas/client/restful_models.py | 1 + tests/conftest.py | 1 + tests/test_job_status.py | 1 + 4 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f85b84d6..def0a0d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ nylas-python Changelog ====================== +Unreleased +---------------- +* Add `metadata` field to `JobStatus` + v5.9.2 ---------------- * Add `enforce_read_only` parameter to overriding `as_json` functions diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py index 94172a84..0b72a725 100644 --- a/nylas/client/restful_models.py +++ b/nylas/client/restful_models.py @@ -829,6 +829,7 @@ class JobStatus(NylasAPIObject): "object", "status", "original_data", + "metadata", ] datetime_attrs = {"created_at": "created_at"} collection_name = "job-statuses" diff --git a/tests/conftest.py b/tests/conftest.py index 58897346..17e3c69c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1767,6 +1767,7 @@ def mock_job_statuses(mocked_responses, api_url): "job_status_id": "test_job_status_id", "object": "message", "status": "successful", + "metadata": {"message_id": "nylas_message_id"}, }, { "account_id": "test_account_id", diff --git a/tests/test_job_status.py b/tests/test_job_status.py index f3c826a6..f5a89c58 100644 --- a/tests/test_job_status.py +++ b/tests/test_job_status.py @@ -28,6 +28,7 @@ def test_job_status(api_client): assert job_status["object"] == "message" assert job_status["status"] == "successful" assert job_status["created_at"] == datetime(2021, 6, 4, 22, 36) + assert job_status["metadata"] == {"message_id": "nylas_message_id"} @pytest.mark.usefixtures("mock_job_statuses")