From ba90fec720339f85f0face6e6513369913d8fd3f Mon Sep 17 00:00:00 2001 From: Tatsuo Nagamatsu Date: Fri, 1 Feb 2019 10:42:17 +0900 Subject: [PATCH 1/4] Add Avatar to requestUser structure --- requestUserMapper.go | 1 + user_api.go | 1 + 2 files changed, 2 insertions(+) diff --git a/requestUserMapper.go b/requestUserMapper.go index 4aade53..81e967f 100644 --- a/requestUserMapper.go +++ b/requestUserMapper.go @@ -17,6 +17,7 @@ func (rum RequestUserMapper) ConvertUser(user *User) requestUser { Phone: user.Phone, UserID: user.UserID, Name: user.Name, + Avatar: user.Avatar, SignedUpAt: user.SignedUpAt, RemoteCreatedAt: user.RemoteCreatedAt, LastRequestAt: user.LastRequestAt, diff --git a/user_api.go b/user_api.go index 9ccba6c..70fcb22 100644 --- a/user_api.go +++ b/user_api.go @@ -31,6 +31,7 @@ type requestUser struct { Phone string `json:"phone,omitempty"` UserID string `json:"user_id,omitempty"` Name string `json:"name,omitempty"` + Avatar *UserAatar `json:"avatar,omitempty"` SignedUpAt int64 `json:"signed_up_at,omitempty"` RemoteCreatedAt int64 `json:"remote_created_at,omitempty"` LastRequestAt int64 `json:"last_request_at,omitempty"` From afd7fcbb6498e5c487ef7a7edb6597511e8c7d40 Mon Sep 17 00:00:00 2001 From: Tatsuo Nagamatsu Date: Fri, 1 Feb 2019 10:59:48 +0900 Subject: [PATCH 2/4] fix typo --- user_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_api.go b/user_api.go index 70fcb22..234b013 100644 --- a/user_api.go +++ b/user_api.go @@ -31,7 +31,7 @@ type requestUser struct { Phone string `json:"phone,omitempty"` UserID string `json:"user_id,omitempty"` Name string `json:"name,omitempty"` - Avatar *UserAatar `json:"avatar,omitempty"` + Avatar *UserAvatar `json:"avatar,omitempty"` SignedUpAt int64 `json:"signed_up_at,omitempty"` RemoteCreatedAt int64 `json:"remote_created_at,omitempty"` LastRequestAt int64 `json:"last_request_at,omitempty"` From 0a97e78afd4692763a1263dd6b9b57d60fcae8b0 Mon Sep 17 00:00:00 2001 From: Tatsuo Nagamatsu Date: Mon, 11 Mar 2019 09:12:35 +0900 Subject: [PATCH 3/4] add CustomAttributes for UserCompany --- requestUserMapper.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/requestUserMapper.go b/requestUserMapper.go index 81e967f..cd91b98 100644 --- a/requestUserMapper.go +++ b/requestUserMapper.go @@ -3,9 +3,10 @@ package intercom // A Company the User belongs to // used to update Companies on a User. type UserCompany struct { - CompanyID string `json:"company_id,omitempty"` - Name string `json:"name,omitempty"` - Remove *bool `json:"remove,omitempty"` + CompanyID string `json:"company_id,omitempty"` + Name string `json:"name,omitempty"` + Remove *bool `json:"remove,omitempty"` + CustomAttributes map[string]interface{} `json:"custom_attributes,omitempty"` } type RequestUserMapper struct{} @@ -42,9 +43,10 @@ func (rum RequestUserMapper) MakeUserCompaniesFromCompanies(companies []Company) userCompanies := make([]UserCompany, len(companies)) for i := 0; i < len(companies); i++ { userCompanies[i] = UserCompany{ - CompanyID: companies[i].CompanyID, - Name: companies[i].Name, - Remove: companies[i].Remove, + CompanyID: companies[i].CompanyID, + Name: companies[i].Name, + Remove: companies[i].Remove, + CustomAttributes: companies[i].CustomAttributes, } } return userCompanies From 96e40e43d03327be6a74617aee2a871f9f72d8d6 Mon Sep 17 00:00:00 2001 From: Tatsuo Nagamatsu Date: Mon, 11 Mar 2019 12:18:47 +0900 Subject: [PATCH 4/4] Revert "add CustomAttributes for UserCompany" This reverts commit 0a97e78afd4692763a1263dd6b9b57d60fcae8b0. --- requestUserMapper.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/requestUserMapper.go b/requestUserMapper.go index cd91b98..81e967f 100644 --- a/requestUserMapper.go +++ b/requestUserMapper.go @@ -3,10 +3,9 @@ package intercom // A Company the User belongs to // used to update Companies on a User. type UserCompany struct { - CompanyID string `json:"company_id,omitempty"` - Name string `json:"name,omitempty"` - Remove *bool `json:"remove,omitempty"` - CustomAttributes map[string]interface{} `json:"custom_attributes,omitempty"` + CompanyID string `json:"company_id,omitempty"` + Name string `json:"name,omitempty"` + Remove *bool `json:"remove,omitempty"` } type RequestUserMapper struct{} @@ -43,10 +42,9 @@ func (rum RequestUserMapper) MakeUserCompaniesFromCompanies(companies []Company) userCompanies := make([]UserCompany, len(companies)) for i := 0; i < len(companies); i++ { userCompanies[i] = UserCompany{ - CompanyID: companies[i].CompanyID, - Name: companies[i].Name, - Remove: companies[i].Remove, - CustomAttributes: companies[i].CustomAttributes, + CompanyID: companies[i].CompanyID, + Name: companies[i].Name, + Remove: companies[i].Remove, } } return userCompanies