Added GetProjectsResponse to unmarshall get projects response

This commit is contained in:
Louis-Philippe Reid 2021-06-11 10:40:46 -04:00
parent 412cc3323e
commit c843caaa80

View File

@ -533,6 +533,12 @@ func (k *SSHKey) String() string {
return strings.Join(parts, " ") 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 // GetCommitsResponse cast Commits into structure
func GetCommitsResponse(r *APIResponse) ([]Commit, error) { func GetCommitsResponse(r *APIResponse) ([]Commit, error) {
var m []Commit var m []Commit