public ValidateResourceTypeConfigResult <RegistryKeyResource> ValidateConfig(
            ValidateResourceTypeConfigInput <RegistryKeyResource> input)
        {
            _log.LogDebug("{method}: ", nameof(ValidateConfig));
            _log.LogTrace("->input = {@input}", input);

            _log.LogTrace("  * ...Config: " + JsonConvert.SerializeObject(input.Config, Formatting.Indented));

            var result = new ValidateResourceTypeConfigResult <RegistryKeyResource>();

            if (!RegUtil.AllRootAliases.Contains(input.Config.Root))
            {
                result.Error("invalid root, must be one of: "
                             + string.Join(" | ", RegUtil.AllRootAliases),
                             steps: new TFSteps().Attribute("root"));
            }

            if (input.Config.Entries?.Count == 0)
            {
                result.Error("at least one entry must be specified",
                             steps: new TFSteps().Attribute("entries"));
            }
            else
            {
                foreach (var e in input.Config.Entries)
                {
                    var valArgs = 0;
                    if (!string.IsNullOrEmpty(e.Value.Value))
                    {
                        ++valArgs;
                    }
                    if (!string.IsNullOrEmpty(e.Value.ValueBase64))
                    {
                        ++valArgs;
                    }
                    if (e.Value.Values?.Length > 0)
                    {
                        ++valArgs;
                    }

                    if (valArgs != 1)
                    {
                        result.Error("entry must specify exactly one value argument"
                                     + $" (currently = {valArgs}): "
                                     + string.Join(",", ArgumentRegValue.AllValueArguments),
                                     steps: new TFSteps()
                                     .Attribute("entries")
                                     .Element(e.Key));
                    }
                }
            }

            _log.LogTrace("<-result = {@result}", result);
            return(result);
        }
        public ValidateResourceTypeConfigResult <FileResource> ValidateConfig(
            ValidateResourceTypeConfigInput <FileResource> input)
        {
            _log.LogDebug("{method}: ", nameof(PlanChange));
            _log.LogTrace("->input = {@input}", input);

            var result = new ValidateResourceTypeConfigResult <FileResource>();

            var contentArgs = 0;

            if (!string.IsNullOrEmpty(input.Config.Content))
            {
                ++contentArgs;
            }
            if (!string.IsNullOrEmpty(input.Config.ContentBase64))
            {
                ++contentArgs;
            }
            if (!string.IsNullOrEmpty(input.Config.ContentPath))
            {
                ++contentArgs;
            }
            if (!string.IsNullOrEmpty(input.Config.ContentUrl))
            {
                ++contentArgs;
            }
            if (contentArgs != 1)
            {
                result.Error("exactly one of the content source arguments must be specified"
                             + $" ({FileResource.ContentSourceArgumentNames})");
            }

            var csumKey = input.Config.ComputeChecksum;

            if (!string.IsNullOrEmpty(csumKey) &&
                csumKey != FileResource.MD5ChecksumKey &&
                csumKey != FileResource.SHA1ChecksumKey &&
                csumKey != FileResource.SHA256ChecksumKey &&
                csumKey != FileResource.SourceCodeHashKey)
            {
                result.Error("invalid checksum key, allowed keys: "
                             + $" ({FileResource.AllowedChecksumKeys})");
            }

            _log.LogTrace("<-result = {@result}", result);
            return(result);
        }