From c843caaa80f60905f5c7159ccfb21e90ff4a1be8 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Reid Date: Fri, 11 Jun 2021 10:40:46 -0400 Subject: [PATCH] Added GetProjectsResponse to unmarshall get projects response --- api_response.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api_response.go b/api_response.go index 27dd37b..2d735d4 100644 --- a/api_response.go +++ b/api_response.go @@ -533,6 +533,12 @@ func (k *SSHKey) String() string { return strings.Join(parts, " ") } +func GetProjectsResponse(r *APIResponse) ([]Project, error) { + var m []Project + err := mapstructure.Decode(r.Values["values"], &m) + return m, err +} + // GetCommitsResponse cast Commits into structure func GetCommitsResponse(r *APIResponse) ([]Commit, error) { var m []Commit