Пример #1
0
 public InputMap() : this(Output.Create(ImmutableDictionary <string, V> .Empty))
 {
 }
Пример #2
0
 private InputMap(Output <ImmutableDictionary <string, V> > values)
     : base(values)
 {
 }
Пример #3
0
 /// <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)));
Пример #4
0
 /// <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));
 }
Пример #5
0
 /// <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));
Пример #6
0
 /// <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));
Пример #7
0
        /// <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);
        }
Пример #8
0
 /// <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));
Пример #9
0
 public static Output <T> CreateSecret <T>(Task <T> value)
 => Output <T> .CreateSecret(value);
Пример #10
0
 public static Output <T> Create <T>(Task <T> value)
 => Output <T> .Create(value);
Пример #11
0
 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));