thygesteffensen / PowerAutomateMockUp

Skeleton to run Power Automate Flows from their JSON descriptions.
MIT License
7 stars 1 forks source link

Maybe implement another storage option? #20

Closed github-actions[bot] closed 3 years ago

github-actions[bot] commented 3 years ago

Maybe implement another storage option?

https://github.com/thygesteffensen/PowerAutomateMockUp/blob/a9d1da4826a9f3f0237f46125e03dc1b85e6ab7d/PowerAutomateMockUp/ExpressionParser/Functions/Storage/ItemsFunction.cs#L24

using Parser.ExpressionParser.Functions.Base;
using Parser.ExpressionParser.Functions.CustomException;

namespace Parser.ExpressionParser.Functions.Storage
{
    public class ItemsFunction : Function
    {
        private readonly IState _variableRetriever;

        public ItemsFunction(IState variableRetriever) : base("items")
        {
            _variableRetriever = variableRetriever ?? throw new ArgumentNullException(nameof(variableRetriever));
        }

        public override ValueContainer ExecuteFunction(params ValueContainer[] parameters)
        {
            if (parameters.Length != 1)
            {
                throw new ArgumentError(parameters.Length > 1 ? "Too many arguments" : "Too few arguments");
            }

            var variableName = parameters[0].GetValue<string>();
            // TODO: Maybe implement another storage option?
            var value = _variableRetriever.GetOutputs($"item_{variableName}");

            return value;
        }
    }
}
 No newline at end of file
ndex bedbb8a..8f5cf70 100644
++ b/PowerAutomateMockUp/ExpressionParser/ValueContainer.cs

a3f14fddd7ceca4315bd69bfc05f9a870905891d

thygesteffensen commented 3 years ago

:tada: This issue has been resolved in version 1.0.0-alpha.29 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

thygesteffensen commented 3 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: