This commit is contained in:
2025-05-21 16:38:25 +03:00
parent 2c70109d2d
commit 9e68edb2b9
1034 changed files with 73925 additions and 3187 deletions

View File

@@ -147,3 +147,39 @@ func flattenSepConsumptionPools(bp *sep.RecordConsumption) []map[string]interfac
}
return sh
}
func flattenAvailableSEPList(d *schema.ResourceData, sepList *sep.ListAvailableSEP) {
d.Set("items", flattenSEPDataList(sepList.Data))
d.Set("entry_count", sepList.EntryCount)
}
func flattenSEPDataList(sepDataList []sep.SEPData) []map[string]interface{} {
sh := make([]map[string]interface{}, 0)
for _, sepData := range sepDataList {
temp := map[string]interface{}{
"sep_id": sepData.SEPID,
"sep_name": sepData.SEPName,
"sep_type": sepData.SEPType,
"pools": flattenPoolList(sepData.Pools),
}
sh = append(sh, temp)
}
return sh
}
func flattenPoolList(pools []sep.Pool) []map[string]interface{} {
sh := make([]map[string]interface{}, 0)
for _, pool := range pools {
temp := map[string]interface{}{
"name": pool.Name,
"types": pool.Types,
"system": pool.System,
}
sh = append(sh, temp)
}
return sh
}