PropertyToString converts a Pulumi PropertyValue to a string.
(v resource.PropertyValue)
| 40 | |
| 41 | // PropertyToString converts a Pulumi PropertyValue to a string. |
| 42 | func PropertyToString(v resource.PropertyValue) string { |
| 43 | if v.IsString() { |
| 44 | return v.StringValue() |
| 45 | } |
| 46 | if v.IsNumber() { |
| 47 | return fmt.Sprintf("%g", v.NumberValue()) |
| 48 | } |
| 49 | if v.IsBool() { |
| 50 | if v.BoolValue() { |
| 51 | return "true" |
| 52 | } |
| 53 | return "false" |
| 54 | } |
| 55 | return "" |
| 56 | } |
| 57 | |
| 58 | // ApplyValueMap translates a raw value using the provided map. |
| 59 | // Lookup is case-insensitive; if no mapping matches the original value is returned. |
no outgoing calls
no test coverage detected