Class ValueMapper
Provides utilities for converting Value trees into plain .NET objects.
Inherited Members
Namespace: Pulumi.Esc.Sdk
Assembly: Pulumi.Esc.Sdk.dll
Syntax
public static class ValueMapper
Methods
View SourceMapValuePrimitive(Value?)
Recursively unwraps a Value into a plain .NET object.
- Scalar values (string, bool, number) are returned as-is.
- Object values become
Dictionary<string, object?>. - Array values become
List<object?>.
Declaration
public static object? MapValuePrimitive(Value? value)
Parameters
| Type | Name | Description |
|---|---|---|
| Value | value | The value to unwrap. |
Returns
| Type | Description |
|---|---|
| object | The unwrapped plain object. |
MapValues(ModelEnvironment?)
Extracts the resolved values from a ModelEnvironment as a flat dictionary of property name to plain .NET object (primitives, dictionaries, lists).
Declaration
public static Dictionary<string, object?>? MapValues(ModelEnvironment? environment)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelEnvironment | environment | The resolved environment. |
Returns
| Type | Description |
|---|---|
| Dictionary<string, object> | A dictionary of property names to their resolved primitive values, or null if the environment has no properties. |
UnwrapPrimitive(object?)
Recursively unwraps an arbitrary object that may contain nested Value objects, JSON elements, dictionaries, or arrays into plain .NET objects.
Declaration
public static object? UnwrapPrimitive(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to unwrap. |
Returns
| Type | Description |
|---|---|
| object | The unwrapped plain object. |