public static PSCustomRule ToPSCustomRule(this SdkCustomRule sdkRule) { return(new PSCustomRule { RateLimitDurationInMinutes = sdkRule.RateLimitDurationInMinutes, RateLimitThreshold = sdkRule.RateLimitThreshold, Name = sdkRule.Name, Action = sdkRule.Action, RuleType = sdkRule.RuleType, Priority = sdkRule.Priority, MatchConditions = sdkRule.MatchConditions?.Select(x => x.ToPSMatchCondition()).ToList() }); }
public static PSCustomRule ToPSCustomRule(this SdkCustomRule sdkRule) { return(new PSCustomRule { RateLimitDurationInMinutes = sdkRule.RateLimitDurationInMinutes, RateLimitThreshold = sdkRule.RateLimitThreshold, Name = sdkRule.Name, Action = sdkRule.Action == null ? (PSAction?)null : (PSAction)Enum.Parse(typeof(PSAction), sdkRule.Action), RuleType = sdkRule.RuleType == null ? (PSCustomRuleType?)null : (PSCustomRuleType)Enum.Parse(typeof(PSCustomRuleType), sdkRule.RuleType), Priority = sdkRule.Priority, MatchConditions = sdkRule.MatchConditions?.Select(x => x.ToPSMatchCondition()).ToList() }); }