forked from opalsecurity/opal-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.go
28 lines (26 loc) · 965 Bytes
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Utils to facilitate easier usage of the SDK.
*/
package opal
func GroupToUpdateGroupInfo(group Group) (updateGroupInfo UpdateGroupInfo) {
return UpdateGroupInfo{
GroupId: group.GroupId,
Description: group.Description,
OwnerTeamId: group.OwnerTeamId,
Visibility: group.Visibility,
MaxDuration: group.MaxDuration,
RequireManagerApproval: group.RequireManagerApproval,
RequireSupportTicket: group.RequireSupportTicket,
}
}
func ResourceToUpdateResourceInfo(resource Resource) (updateResourceInfo UpdateResourceInfo) {
return UpdateResourceInfo{
ResourceId: resource.ResourceId,
Description: resource.Description,
OwnerTeamId: resource.OwnerTeamId,
Visibility: resource.Visibility,
MaxDuration: resource.MaxDuration,
RequireManagerApproval: resource.RequireManagerApproval,
RequireSupportTicket: resource.RequireSupportTicket,
}
}