Skip to content

Commit

Permalink
Include subprojects in Project struct
Browse files Browse the repository at this point in the history
The Projects field, which includes references to all subprojects, was
always in the payload returned from TeamCity, but was not returned from
the .GetBy(ID|Name) functions due to it not being part of the Project
struct.
  • Loading branch information
atavakoliyext committed Aug 30, 2024
1 parent 3a0a9e1 commit 3042447
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions teamcity/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Project struct {
ParentProjectID string `json:"parentProjectId,omitempty" xml:"parentProjectId"`
WebURL string `json:"webUrl,omitempty" xml:"webUrl"`
BuildTypes BuildTypeReferences `json:"buildTypes,omitempty" xml:"buildTypes"`
Projects ProjectReferences `json:"projects,omitempty" xml:"projects"`
}

// ProjectReference contains basic information, usually enough to use as a type for relationships.
Expand All @@ -34,6 +35,15 @@ type ProjectReference struct {
WebURL string `json:"webUrl,omitempty" xml:"webUrl"`
}

// ProjectReferences represents a collection of *ProjectReference.
type ProjectReferences struct {
// count
Count int32 `json:"count,omitempty" xml:"count"`

// project
Items []*ProjectReference `json:"project"`
}

// ProjectService has operations for handling projects
type ProjectService struct {
sling *sling.Sling
Expand Down

0 comments on commit 3042447

Please sign in to comment.