Skip to content

Commit 7ea22cc

Browse files
festeveiraFrancisco Esteveira
andauthored
added project.GetChildren (#53)
Co-authored-by: Francisco Esteveira <[email protected]>
1 parent 3464b66 commit 7ea22cc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

project.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,22 @@ func (ps ProjectService) Clone(ctx context.Context, cloneReq ProjectCloneRequest
211211

212212
return
213213
}
214+
215+
func (ps ProjectService) GetChildren(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[Project], err error) {
216+
pathParams := map[string]string{
217+
"uuid": projectUUID.String(),
218+
}
219+
220+
req, err := ps.client.newRequest(ctx, http.MethodGet, "/api/v1/project/{uuid}/children", withPathParams(pathParams), withPageOptions(po))
221+
if err != nil {
222+
return
223+
}
224+
225+
res, err := ps.client.doRequest(req, &p.Items)
226+
if err != nil {
227+
return
228+
}
229+
230+
p.TotalCount = res.TotalCount
231+
return
232+
}

0 commit comments

Comments
 (0)