Skip to content

Commit

Permalink
adding GetId()
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmog committed Apr 30, 2020
1 parent 0580988 commit 5f94b94
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion compliance/standard/requirement/section/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,24 @@ func List(c pc.PrismaCloudClient, rid string) ([]Section, error) {
return ans, nil
}

// GetId returns the compliance requirement section data for the specified ID.
func GetId(c pc.PrismaCloudClient, rid, id string) (Section, error) {
list, err := List(c, rid)
if err != nil {
return Section{}, err
}

for _, o := range list {
if o.Id == id {
return o, nil
}
}

return Section{}, pc.ObjectNotFoundError
}

// Get returns the compliance requirement section data for the specified requirements section ID.
func Get(c pc.PrismaCloudClient, rid string, sectionId string) (Section, error) {
func Get(c pc.PrismaCloudClient, rid, sectionId string) (Section, error) {
list, err := List(c, rid)
if err != nil {
return Section{}, err
Expand Down

0 comments on commit 5f94b94

Please sign in to comment.