Class InputList<T>
A list of 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.
InputList<T> differs from a normal
IList<T> in that it is itself
an
Input<T>. For example, a
Resource that accepts an
InputList<T> will accept not just a list but an
Output<T>
of a list. This is important for cases where the
Output<T>
list from some
Resource needs to be passed into another
Resource. Or for cases where creating the list invariably produces an
Output<T> because its resultant value is dependent on other
Output<T>s.
This benefit of
InputList<T> 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 list synchronously.
InputList<T> is designed to be easily used in object and collection
initializers. For example, a resource that accepts a list of inputs can be written in
either of these forms:
new SomeResource("name", new SomeResourceArgs {
ListProperty = { Value1, Value2, Value3 },
});
or
new SomeResource("name", new SomeResourceArgs {
ListProperty = new [] { Value1, Value2, Value3 },
});
Assembly: Pulumi.dll
public sealed class InputList<T> : Input<ImmutableArray<T>>, IEnumerable, IAsyncEnumerable<Input<T>>
Type Parameters
Constructors
View Source
Declaration
Methods
View Source
Declaration
public void Add(params Input<T>[] inputs)
Parameters
Type |
Name |
Description |
Input<T>[] |
inputs |
|
View Source
Note: this is non-standard convenience for use with collection initializers.
Declaration
public void Add(InputList<T> inputs)
Parameters
View Source
Declaration
public void AddRange(InputList<T> inputs)
Parameters
View Source
Concatenates the values in this list with the values in other
,
returning the concatenated sequence in a new InputList<T>.
Declaration
public InputList<T> Concat(InputList<T> other)
Parameters
Returns
View Source
Declaration
public IAsyncEnumerator<Input<T>> GetAsyncEnumerator(CancellationToken cancellationToken)
Parameters
Returns
Operators
View Source
Declaration
public static implicit operator InputList<T>(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(T[] values)
Parameters
Type |
Name |
Description |
T[] |
values |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Input<T> value)
Parameters
Type |
Name |
Description |
Input<T> |
value |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Input<T>[] values)
Parameters
Type |
Name |
Description |
Input<T>[] |
values |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<T[]> values)
Parameters
Type |
Name |
Description |
Output<T[]> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<T> value)
Parameters
Type |
Name |
Description |
Output<T> |
value |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<T>[] values)
Parameters
Type |
Name |
Description |
Output<T>[] |
values |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<IEnumerable<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<List<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(Output<ImmutableArray<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(List<T> values)
Parameters
Type |
Name |
Description |
List<T> |
values |
|
Returns
View Source
Declaration
public static implicit operator InputList<T>(List<Input<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(List<Output<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(ImmutableArray<T> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(ImmutableArray<Input<T>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputList<T>(ImmutableArray<Output<T>> values)
Parameters
Returns
Implements
Extension Methods