public override void ExecuteCmdlet() { if (!string.IsNullOrEmpty(Name)) { RulesAttributes ruleAttributes = Client.GetRule(ResourceGroupName, Namespace, Topic, Subscription, Name); WriteObject(ruleAttributes); } else { IEnumerable <RulesAttributes> ruleAttributes = Client.ListRules(ResourceGroupName, Namespace, Topic, Subscription); WriteObject(ruleAttributes, true); } }
public override void ExecuteCmdlet() { RulesAttributes ruleAttributes = new RulesAttributes(); if (!string.IsNullOrEmpty(SqlExpression)) { ruleAttributes.SqlFilter.SqlExpression = SqlExpression; } if (ShouldProcess(target: Name, action: string.Format(Resources.CreateRule, Name, Topic, Namespace))) { WriteObject(Client.CreateUpdateRules(ResourceGroupName, Namespace, Topic, Subscription, Name, ruleAttributes)); } }
public override void ExecuteCmdlet() { RulesAttributes rulesAttributes = new RulesAttributes(); if (InputObject != null) { rulesAttributes = InputObject; } if (ShouldProcess(target: Name, action: string.Format(Resources.UpdateRule, Name, Namespace))) { WriteObject(Client.CreateUpdateRules(ResourceGroupName, Namespace, Topic, Subscription, Name, rulesAttributes)); } }
public RulesAttributes CreateUpdateRules(string resourceGroupName, string namespaceName, string topicName, string subscriptionName, string ruleName, RulesAttributes ruleAttributes) { var parameters = new Rule() { Action = new Management.ServiceBus.Models.Action(), SqlFilter = new SqlFilter() { RequiresPreprocessing = ruleAttributes.SqlFilter.RequiresPreprocessing, SqlExpression = ruleAttributes.SqlFilter.SqlExpression }, CorrelationFilter = new CorrelationFilter() { CorrelationId = ruleAttributes.CorrelationFilter.CorrelationId, MessageId = ruleAttributes.CorrelationFilter.MessageId, To = ruleAttributes.CorrelationFilter.To, ReplyTo = ruleAttributes.CorrelationFilter.ReplyTo, Label = ruleAttributes.CorrelationFilter.Label, SessionId = ruleAttributes.CorrelationFilter.SessionId, ReplyToSessionId = ruleAttributes.CorrelationFilter.ReplyToSessionId, ContentType = ruleAttributes.CorrelationFilter.ContentType, RequiresPreprocessing = ruleAttributes.CorrelationFilter.RequiresPreprocessing, } }; var response = Client.Rules.CreateOrUpdate(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters); return(new RulesAttributes(response)); }