Skip to content

Commit

Permalink
Merge pull request #60 from louisphilippereid/get-projects-response
Browse files Browse the repository at this point in the history
Added GetProjectsResponse to unmarshall get projects response
  • Loading branch information
gfleury authored Aug 30, 2023
2 parents 7336cc1 + c843caa commit 6e30c57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,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
Expand Down

0 comments on commit 6e30c57

Please sign in to comment.