FormatInputProperties serialises a Pulumi PropertyMap to indented JSON for display/debugging purposes.
(inputs resource.PropertyMap)
| 75 | // FormatInputProperties serialises a Pulumi PropertyMap to indented JSON for |
| 76 | // display/debugging purposes. |
| 77 | func FormatInputProperties(inputs resource.PropertyMap) string { |
| 78 | if len(inputs) == 0 { |
| 79 | return "" |
| 80 | } |
| 81 | |
| 82 | data, err := json.MarshalIndent(PropertyMapToAny(inputs), "", " ") |
| 83 | if err != nil { |
| 84 | return fmt.Sprintf("%v", inputs) |
| 85 | } |
| 86 | return string(data) |
| 87 | } |
| 88 | |
| 89 | // PropertyMapToAny converts a Pulumi PropertyMap to a plain map[string]any. |
| 90 | func PropertyMapToAny(pm resource.PropertyMap) map[string]any { |
no test coverage detected