public virtual List <PSFunction> FilterPSFunctions(FunctionFilterOptions filterOptions) { if (filterOptions == null) { throw new ArgumentNullException("filterOptions"); } if (string.IsNullOrWhiteSpace(filterOptions.ResourceGroupName)) { throw new ArgumentException(Resources.ResourceGroupNameCannotBeEmpty); } if (string.IsNullOrWhiteSpace(filterOptions.JobName)) { throw new ArgumentException(Resources.JobNameCannotBeEmpty); } List <PSFunction> functions = new List <PSFunction>(); if (!string.IsNullOrWhiteSpace(filterOptions.Name)) { functions.Add(GetFunction(filterOptions.ResourceGroupName, filterOptions.JobName, filterOptions.Name)); } else { functions.AddRange(ListFunctions(filterOptions.ResourceGroupName, filterOptions.JobName)); } return(functions); }
public virtual List<PSFunction> FilterPSFunctions(FunctionFilterOptions filterOptions) { if (filterOptions == null) { throw new ArgumentNullException("filterOptions"); } if (string.IsNullOrWhiteSpace(filterOptions.ResourceGroupName)) { throw new ArgumentException(Resources.ResourceGroupNameCannotBeEmpty); } if (string.IsNullOrWhiteSpace(filterOptions.JobName)) { throw new ArgumentException(Resources.JobNameCannotBeEmpty); } List<PSFunction> functions = new List<PSFunction>(); if (!string.IsNullOrWhiteSpace(filterOptions.Name)) { functions.Add(GetFunction(filterOptions.ResourceGroupName, filterOptions.JobName, filterOptions.Name)); } else { functions.AddRange(ListFunctions(filterOptions.ResourceGroupName, filterOptions.JobName)); } return functions; }
public override void ExecuteCmdlet() { if (ResourceGroupName != null && string.IsNullOrWhiteSpace(ResourceGroupName)) { throw new PSArgumentNullException("ResourceGroupName"); } if (JobName != null && string.IsNullOrWhiteSpace(JobName)) { throw new PSArgumentNullException("JobName"); } if (Name == null || string.IsNullOrWhiteSpace(Name)) { Name = string.Empty; } FunctionFilterOptions filterOptions = new FunctionFilterOptions() { Name = Name, JobName = JobName, ResourceGroupName = ResourceGroupName }; WriteObject(StreamAnalyticsClient.FilterPSFunctions(filterOptions), true); }