INNER CODE UNIT · Go
addAttributeKeyValue
cloudflare/cf-terraforming · internal/app/cf-terraforming/cmd/custom_processing.go:624
func addAttributeKeyValue(response *[]interface{}, resourceCount int, key string, value string) {
for i := 0; i < resourceCount; i++ {
(*response)[i].(map[string]interface{})[key] = value
}
}
func remapProperty(response *[]interface{}, resourceCount int, responseProperty string, remappedProperty string) {
for i := 0; i < resourceCount; i++ {
prop, ok := (*response)[i].(map[string]interface{})[responseProperty]
if !ok {
continue
}
(*response)[i].(map[string]interface{})[remappedProperty] = prop
}
}
func denestResponses(response *[]interface{}, resourceCount int, nestedAttributeName string) {
finalResponse := make([]interface{}, 0)