/// <inheritdoc /> public async Task <IPolicyRule> UpdatePolicyRuleAsync(IPolicyRule policyRule, string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken)) => await PutAsync <PolicyRule>(new HttpRequest { Uri = "/api/v1/policies/{policyId}/rules/{ruleId}", Payload = policyRule, PathParameters = new Dictionary <string, object>() { ["policyId"] = policyId, ["ruleId"] = ruleId, }, }, cancellationToken).ConfigureAwait(false);
public void SetRule(IPolicyRule rule) { this.conditionslb.Items.Clear(); m_rule = rule; this.Text = "Condition details - " + m_rule.Name; this.descriptiontext.Text = m_rule["Description"]; foreach (IPolicyObject policyobject in m_rule.Conditions) { AddExpressions(policyobject, 0); } }
/// <inheritdoc /> public async Task <IPolicyRule> AddPolicyRuleAsync(IPolicyRule policyRule, string policyId, bool?activate = true, CancellationToken cancellationToken = default(CancellationToken)) => await PostAsync <PolicyRule>(new HttpRequest { Uri = "/api/v1/policies/{policyId}/rules", Payload = policyRule, PathParameters = new Dictionary <string, object>() { ["policyId"] = policyId, }, QueryParameters = new Dictionary <string, object>() { ["activate"] = activate, }, }, cancellationToken).ConfigureAwait(false);
/// <inheritdoc/> public async Task <T> UpdatePolicyRuleAsync <T>(IPolicyRule policyRule, string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken)) where T : class, IPolicyRule => await UpdatePolicyRuleAsync(policyRule, policyId, ruleId, cancellationToken).ConfigureAwait(false) as T;
/// <inheritdoc/> public async Task <T> AddPolicyRuleAsync <T>(IPolicyRule policyRule, string policyId, bool?activate, CancellationToken cancellationToken = default(CancellationToken)) where T : class, IPolicyRule => await AddPolicyRuleAsync(policyRule, policyId, activate, cancellationToken).ConfigureAwait(false) as T;
public XmlPolicyRuleWriter(XmlNode xmlParentNode, XmlPolicyCatalogueWriter policyCatalogueWriter, IPolicyRule rule) : base(xmlParentNode, policyCatalogueWriter) { m_rule = rule; }