Class InputMap<V>
A mapping of System.Strings to values that can be passed in as the arguments to a
Resource. The individual values are themselves Input<T>s. i.e.
the individual values can be concrete values or Output<T>s.
InputMap<V> differs from a normal System.Collections.Generic.IDictionary<TKey, TValue> in that it is
itself an Input<T>. For example, a Resource that accepts an
InputMap<V> will accept not just a dictionary but an Output<T>
of a dictionary as well. This is important for cases where the Output<T>
map from some Resource needs to be passed into another Resource.
Or for cases where creating the map invariably produces an Output<T> because
its resultant value is dependent on other Output<T>s.
This benefit of InputMap<V> is also a limitation. Because it represents a
list of values that may eventually be created, there is no way to simply iterate over, or
access the elements of the map synchronously.
InputMap<V> is designed to be easily used in object and collection
initializers. For example, a resource that accepts a map of values can be written easily in
this form:
new SomeResource("name", new SomeResourceArgs {
MapProperty = {
{ Key1, Value1 },
{ Key2, Value2 },
{ Key3, Value3 },
},
});
Inheritance
System.Object
Input<
System.Collections.Immutable.ImmutableDictionary<
System.String, V>>
InputMap<V>
Implements
System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<
Input<
System.Collections.Generic.KeyValuePair<
System.String, V>>>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Pulumi.dll
public sealed class InputMap<V> : Input<ImmutableDictionary<string, V>>, IEnumerable, IAsyncEnumerable<Input<KeyValuePair<string, V>>>
Type Parameters
Constructors
View Source
Declaration
Properties
View Source
Declaration
public Input<V> this[string key] { set; }
Parameters
Type |
Name |
Description |
System.String |
key |
|
Property Value
Type |
Description |
Input<V> |
|
Methods
View Source
Note: this is non-standard convenience for use with collection initializers.
Declaration
public void Add(InputMap<V> values)
Parameters
Type |
Name |
Description |
InputMap<V> |
values |
|
View Source
Declaration
public void Add(string key, Input<V> value)
Parameters
Type |
Name |
Description |
System.String |
key |
|
Input<V> |
value |
|
View Source
Declaration
public void AddRange(InputMap<V> values)
Parameters
Type |
Name |
Description |
InputMap<V> |
values |
|
View Source
Declaration
public async IAsyncEnumerator<Input<KeyValuePair<string, V>>> GetAsyncEnumerator(CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Collections.Generic.IAsyncEnumerator<Input<System.Collections.Generic.KeyValuePair<System.String, V>>> |
|
View Source
Merge two instances of InputMap<V>. Returns a new InputMap<V>
without modifying any of the arguments.
If both maps contain the same key, the value from the second map takes over.
Declaration
public static InputMap<V> Merge(InputMap<V> first, InputMap<V> second)
Parameters
Returns
Type |
Description |
InputMap<V> |
A new instance of InputMap<V> that contains the items from
both input maps.
|
Operators
View Source
Declaration
public static implicit operator InputMap<V>(Output<Dictionary<string, V>> values)
Parameters
Type |
Name |
Description |
Output<System.Collections.Generic.Dictionary<System.String, V>> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputMap<V>(Output<IDictionary<string, V>> values)
Parameters
Type |
Name |
Description |
Output<System.Collections.Generic.IDictionary<System.String, V>> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputMap<V>(Output<ImmutableDictionary<string, V>> values)
Parameters
Type |
Name |
Description |
Output<System.Collections.Immutable.ImmutableDictionary<System.String, V>> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputMap<V>(Dictionary<string, V> values)
Parameters
Type |
Name |
Description |
System.Collections.Generic.Dictionary<System.String, V> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputMap<V>(ImmutableDictionary<string, V> values)
Parameters
Type |
Name |
Description |
System.Collections.Immutable.ImmutableDictionary<System.String, V> |
values |
|
Returns
Explicit Interface Implementations
View Source
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
Implements
System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<T>
Extension Methods