Show / Hide Table of Contents

Class ValueMapper

Provides utilities for converting Value trees into plain .NET objects.

Inheritance
object
ValueMapper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Pulumi.Esc.Sdk
Assembly: Pulumi.Esc.Sdk.dll
Syntax
public static class ValueMapper

Methods

View Source

MapValuePrimitive(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?>.

The Trace, Secret, and Unknown metadata is stripped.

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.

View Source

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.

View Source

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.

Version 0.13.1

  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.