public static SdkRulesEngineRule ToSdkRulesEngineRule(this PSRulesEngineRule psRulesEngineRule) { return(new SdkRulesEngineRule ( name: psRulesEngineRule.Name, priority: psRulesEngineRule.Priority, action: ToSdkRulesEngineAction(psRulesEngineRule.Action), matchConditions: psRulesEngineRule.MatchConditions?.Select(x => ToSdkMatchcondition(x)).ToList(), matchProcessingBehavior: psRulesEngineRule.MatchProcessingBehavior.ToString() )); }
public override void ExecuteCmdlet() { // Validations // Priority >= 0 var rule = new PSRulesEngineRule { Name = Name, Priority = Priority, Action = Action, }; if (this.IsParameterBound(c => c.MatchProcessingBehavior)) { rule.MatchProcessingBehavior = MatchProcessingBehavior; } if (this.IsParameterBound(c => c.MatchCondition)) { rule.MatchConditions = MatchCondition.ToList(); } WriteObject(rule); }