public InputMap() : this(Output.Create(ImmutableDictionary <string, V> .Empty)) { }
private InputMap(Output <ImmutableDictionary <string, V> > values) : base(values) { }
/// <summary> /// <see cref="All{T}(Output{T}[])"/> for more details. /// </summary> public static Output <ImmutableArray <T> > All <T>(IEnumerable <Output <T> > outputs) => Output <T> .All(ImmutableArray.CreateRange(outputs.Select(o => (Input <T>)o)));
/// <summary> /// <see cref="SerializeResourcePropertiesAsync"/> walks the props object passed in, /// awaiting all interior promises besides those for <see cref="Resource.Urn"/> and <see /// cref="CustomResource.Id"/>, creating a reasonable POCO object that can be remoted over /// to registerResource. /// </summary> private static Task <SerializationResult> SerializeResourcePropertiesAsync( string label, IDictionary <string, IInput?> args) { return(SerializeFilteredPropertiesAsync( label, Output.Create(args), key => key != Constants.IdPropertyName && key != Constants.UrnPropertyName)); }
/// <summary> /// Combines all the <see cref="Input{T}"/> values in <paramref name="inputs"/> /// into a single <see cref="Output{T}"/> with an <see cref="ImmutableArray{T}"/> /// containing all their underlying values. If any of the <see cref="Input{T}"/>s are not /// known, the final result will be not known. Similarly, if any of the <see /// cref="Input{T}"/>s are secrets, then the final result will be a secret. /// </summary> public static Output <ImmutableArray <T> > All <T>(params Input <T>[] inputs) => Output <T> .All(ImmutableArray.CreateRange(inputs));
/// <summary> /// <see cref="All{T}(Input{T}[])"/> for more details. /// </summary> public static Output <ImmutableArray <T> > All <T>(IEnumerable <Input <T> > inputs) => Output <T> .All(ImmutableArray.CreateRange(inputs));
/// <summary> /// Retrieves the secretness status of the given output. /// </summary> public static async Task <bool> IsSecretAsync <T>(Output <T> output) { var dataTask = await output.DataTask.ConfigureAwait(false); return(dataTask.IsSecret); }
/// <summary> /// Returns a new <see cref="Output{T}"/> which is a copy of the existing output but marked as /// a non-secret. The original output is not modified in any way. /// </summary> public static Output <T> Unsecret <T>(Output <T> output) => output.WithIsSecret(Task.FromResult(false));
public static Output <T> CreateSecret <T>(Task <T> value) => Output <T> .CreateSecret(value);
public static Output <T> Create <T>(Task <T> value) => Output <T> .Create(value);
internal static Output <ImmutableArray <T> > Concat <T>(Output <ImmutableArray <T> > values1, Output <ImmutableArray <T> > values2) => Tuple(values1, values2).Apply(a => a.Item1.AddRange(a.Item2));