You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.4 KiB
65 lines
1.4 KiB
package account
|
|
|
|
// IDs gets array of AccountIDs from ListAccounts struct
|
|
func (la ListAccounts) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(la.Data))
|
|
for _, acc := range la.Data {
|
|
res = append(res, acc.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of ComputeIDs from ListComputes struct
|
|
func (lc ListComputes) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lc.Data))
|
|
for _, c := range lc.Data {
|
|
res = append(res, c.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of DiskIDs from ListDisks struct
|
|
func (ld ListDisks) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(ld.Data))
|
|
for _, d := range ld.Data {
|
|
res = append(res, d.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of FLIPGroupIDs from ListFLIPGroups struct
|
|
func (fg ListFLIPGroups) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(fg.Data))
|
|
for _, g := range fg.Data {
|
|
res = append(res, g.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of AccountIDs from ListResourceConsumption struct
|
|
func (rc ListResources) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(rc.Data))
|
|
for _, r := range rc.Data {
|
|
res = append(res, r.AccountID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of RGIDs from ListRG struct
|
|
func (rg ListRG) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(rg.Data))
|
|
for _, g := range rg.Data {
|
|
res = append(res, g.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of VINSIDs from ListVINS struct
|
|
func (lv ListVINS) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lv.Data))
|
|
for _, v := range lv.Data {
|
|
res = append(res, v.ID)
|
|
}
|
|
return res
|
|
}
|