package rg

// IDs gets array of ResourceGroupIDs from ListRG struct
func (lrg ListRG) IDs() []uint64 {
	res := make([]uint64, 0, len(lrg.Data))
	for _, rg := range lrg.Data {
		res = append(res, rg.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 LBIDs from ListLB struct
func (llb ListLB) IDs() []uint64 {
	res := make([]uint64, 0, len(llb.Data))
	for _, lb := range llb.Data {
		res = append(res, lb.ID)
	}
	return res
}

// IDs gets array of VINSIDs from ListVINS struct
func (llb ListVINS) IDs() []uint64 {
	res := make([]uint64, 0, len(llb.Data))
	for _, vi := range llb.Data {
		res = append(res, vi.ID)
	}
	return res
}

// IDs gets array of ResourceGroupIDs from ListResourceConsumption struct
func (lrc ListResourceConsumption) IDs() []uint64 {
	res := make([]uint64, 0, len(lrc.Data))
	for _, rg := range lrc.Data {
		res = append(res, rg.RGID)
	}
	return res
}

// IDs gets array of VINSIDs from ListPFW struct
func (lpfw ListPFW) IDs() []uint64 {
	res := make([]uint64, 0, len(lpfw.Data))
	for _, pfw := range lpfw.Data {
		res = append(res, pfw.VINSID)
	}
	return res
}

// IDs gets array of ComputeIDs from ListAffinityGroupItems struct
func (lag ListAffinityGroupItems) IDs() []uint64 {
	res := make([]uint64, 0, len(lag))
	for _, ag := range lag {
		res = append(res, ag.ID)
	}
	return res
}
