(allocation *users.SpaceAllocation)
| 89 | } |
| 90 | |
| 91 | func newDuAllocation(allocation *users.SpaceAllocation) duAllocation { |
| 92 | result := duAllocation{ |
| 93 | Type: allocation.Tag, |
| 94 | } |
| 95 | |
| 96 | switch allocation.Tag { |
| 97 | case "individual": |
| 98 | result.Allocated = uint64Ptr(allocation.Individual.Allocated) |
| 99 | case "team": |
| 100 | result.Allocated = uint64Ptr(allocation.Team.Allocated) |
| 101 | result.Used = uint64Ptr(allocation.Team.Used) |
| 102 | result.UserWithinTeamSpaceAllocated = uint64Ptr(allocation.Team.UserWithinTeamSpaceAllocated) |
| 103 | result.UserWithinTeamSpaceUsedCached = uint64Ptr(allocation.Team.UserWithinTeamSpaceUsedCached) |
| 104 | if allocation.Team.UserWithinTeamSpaceLimitType != nil { |
| 105 | result.UserWithinTeamSpaceLimitType = allocation.Team.UserWithinTeamSpaceLimitType.Tag |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | return result |
| 110 | } |
| 111 | |
| 112 | func uint64Ptr(value uint64) *uint64 { |
| 113 | return &value |
no test coverage detected