From 37cb8757af515d1db7ca24afe68e2d2a811f5f98 Mon Sep 17 00:00:00 2001 From: Daniel Camilleri Date: Thu, 16 Apr 2020 11:18:20 +0100 Subject: [PATCH 1/3] Updated member tags data structure to fix json marshalling issue when retrieving members --- members.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/members.go b/members.go index 51b9fc5..2467720 100644 --- a/members.go +++ b/members.go @@ -23,6 +23,11 @@ type ListOfMembers struct { Members []Member `json:"members"` } +type ChimpTags struct { + TagID int `json:"id"` + TagName string `json:"name"` +} + type MemberRequest struct { EmailAddress string `json:"email_address"` EmailType string `json:"email_type,omitempty"` @@ -35,7 +40,7 @@ type MemberRequest struct { Location *MemberLocation `json:"location,omitempty"` IPOpt string `json:"ip_opt,omitempty"` IPSignup string `json:"ip_signup,omitempty"` - Tags []string `json:"tags,omitempty"` + Tags []ChimpTags `json:"tags,omitempty"` TimestampSignup string `json:"timestamp_signup,omitempty"` TimestampOpt string `json:"timestamp_opt,omitempty"` } From 4b44ab037b9e5d9b4cb4865171d329546b392f6a Mon Sep 17 00:00:00 2001 From: Daniel Camilleri Date: Sat, 18 Apr 2020 18:27:43 +0100 Subject: [PATCH 2/3] Removed ChimpTag struct and used MemberTag struct within member request --- members.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/members.go b/members.go index 2467720..5c0161b 100644 --- a/members.go +++ b/members.go @@ -23,11 +23,6 @@ type ListOfMembers struct { Members []Member `json:"members"` } -type ChimpTags struct { - TagID int `json:"id"` - TagName string `json:"name"` -} - type MemberRequest struct { EmailAddress string `json:"email_address"` EmailType string `json:"email_type,omitempty"` @@ -40,7 +35,7 @@ type MemberRequest struct { Location *MemberLocation `json:"location,omitempty"` IPOpt string `json:"ip_opt,omitempty"` IPSignup string `json:"ip_signup,omitempty"` - Tags []ChimpTags `json:"tags,omitempty"` + Tags []MemberTag `json:"tags,omitempty"` TimestampSignup string `json:"timestamp_signup,omitempty"` TimestampOpt string `json:"timestamp_opt,omitempty"` } From a817f9c87043855b7ce2ea7fc84abbeefbb0c8d3 Mon Sep 17 00:00:00 2001 From: Daniel Camilleri Date: Sat, 18 Apr 2020 18:28:14 +0100 Subject: [PATCH 3/3] Changed type of Segment.ID from string to int --- segments.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segments.go b/segments.go index 60b2ae4..c8ba30d 100644 --- a/segments.go +++ b/segments.go @@ -23,7 +23,7 @@ type SegmentRequest struct { type Segment struct { SegmentRequest - ID string `json:"id"` + ID int `json:"id"` MemberCount int `json:"member_count"` Type string `json:"type"` CreatedAt string `json:"created_at"`