From 3bb3bf4a52a0d8f15e6180bc528fd044c8660c90 Mon Sep 17 00:00:00 2001 From: Jason Friedland Date: Tue, 2 Nov 2021 12:08:58 +1100 Subject: [PATCH] Add missing sub-account ID field on SuppressionEntry type, update tests --- suppression_list.go | 1 + suppression_list_test.go | 2 ++ test/json/suppression_entry_simple.json | 3 ++- test/json/suppression_retrieve.json | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/suppression_list.go b/suppression_list.go index bb495f2..6643f9d 100644 --- a/suppression_list.go +++ b/suppression_list.go @@ -26,6 +26,7 @@ type SuppressionEntry struct { Description string `json:"description,omitempty"` Updated string `json:"updated,omitempty"` Created string `json:"created,omitempty"` + SubAccountID string `json:"subaccount_id,omitempty"` } // WritableSuppressionEntry stores a recipient’s opt-out preferences. It is a list of recipient email addresses to which you do NOT want to send email. diff --git a/suppression_list_test.go b/suppression_list_test.go index e7453d7..c7f6061 100644 --- a/suppression_list_test.go +++ b/suppression_list_test.go @@ -550,6 +550,8 @@ func verifySuppressionEnty(t *testing.T, suppressionEntry *sp.SuppressionEntry) testFailVerbose(t, nil, "Unexpected Updated: %s", suppressionEntry.Updated) } else if suppressionEntry.NonTransactional != true { testFailVerbose(t, nil, "Unexpected NonTransactional value") + } else if suppressionEntry.SubAccountID != "42" { + testFailVerbose(t, nil, "Unexpected SubAccountID value") } } diff --git a/test/json/suppression_entry_simple.json b/test/json/suppression_entry_simple.json index 6c60713..dc2b7a8 100644 --- a/test/json/suppression_entry_simple.json +++ b/test/json/suppression_entry_simple.json @@ -5,5 +5,6 @@ "type": "non_transactional", "created": "2016-05-02T16:29:56+00:00", "updated": "2016-05-02T17:20:50+00:00", - "non_transactional": true + "non_transactional": true, + "subaccount_id": "42" } \ No newline at end of file diff --git a/test/json/suppression_retrieve.json b/test/json/suppression_retrieve.json index 3b63fd2..ba63ffb 100644 --- a/test/json/suppression_retrieve.json +++ b/test/json/suppression_retrieve.json @@ -7,7 +7,8 @@ "type": "non_transactional", "created": "2016-05-02T16:29:56+00:00", "updated": "2016-05-02T17:20:50+00:00", - "non_transactional": true + "non_transactional": true, + "subaccount_id": "42" } ], "links": [],