MCPcopy Create free account
hub / github.com/dropbox/dbxcli / newDuAllocation

Function newDuAllocation

cmd/du.go:91–110  ·  view source on GitHub ↗
(allocation *users.SpaceAllocation)

Source from the content-addressed store, hash-verified

89}
90
91func 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
112func uint64Ptr(value uint64) *uint64 {
113 return &value

Callers 1

newDuOutputFunction · 0.85

Calls 1

uint64PtrFunction · 0.85

Tested by

no test coverage detected