diff --git a/admin_api.go b/admin_api.go index 5eb08f8..2671348 100644 --- a/admin_api.go +++ b/admin_api.go @@ -2,7 +2,6 @@ package intercom import ( "encoding/json" - "gopkg.in/intercom/intercom-go.v2/interfaces" ) diff --git a/conversation.go b/conversation.go index 0032dd7..b5e84e8 100644 --- a/conversation.go +++ b/conversation.go @@ -22,6 +22,7 @@ type Conversation struct { Read bool `json:"read"` ConversationMessage ConversationMessage `json:"conversation_message"` ConversationParts ConversationPartList `json:"conversation_parts"` + TagList *TagList `json:"tags"` } // A ConversationMessage is the message that started the conversation rendered for presentation diff --git a/conversation_api_test.go b/conversation_api_test.go index e4c694d..e3bb984 100644 --- a/conversation_api_test.go +++ b/conversation_api_test.go @@ -12,6 +12,9 @@ func TestConversationFind(t *testing.T) { if convo.ID != "147" { t.Errorf("Conversation not retrieved, %s", convo.ID) } + if convo.TagList == nil || convo.TagList.Tags[0].ID != "12345" { + t.Errorf("Conversation tags not retrieved, %s", convo.ID) + } } func TestConversationRead(t *testing.T) { @@ -84,6 +87,9 @@ func TestConversationListAll(t *testing.T) { if convos.Conversations[0].ConversationParts.Parts[0].CreatedAt != 1400857494 { t.Errorf("Conversation Part CreatedAt not retrieved") } + if convos.Conversations[0].TagList != nil { + t.Errorf("Conversation Tags should be nil") + } } func TestConversationListUserUnread(t *testing.T) { diff --git a/fixtures/conversation.json b/fixtures/conversation.json index 00846a6..3608f2d 100644 --- a/fixtures/conversation.json +++ b/fixtures/conversation.json @@ -41,5 +41,13 @@ }, "attachments": [] }] + }, + "tags": { + "type": "tag.list", + "tags": [{ + "type": "tag", + "id": "12345", + "name": "Some tag" + }] } }