GroupBuilderQuarantineVariable class
Revision as of 05:06, 3 April 2017 by Nguyenduyan (talk | contribs)
GroupBuilderQuarantineVariable
Represents a group builder variable for users in any of the given quarantines.
Constructors
- () - Create new variable
Methods
- Empty Add(int quarantineResourceId "Quarantine resource id to add") - Add a new quarantine
- int this[] { get; }(int index "Index") - Get quarantine resource id at index
- bool Remove(int quarantineResourceId "Quarantine resource id to remove") - Remove quarantine. Return true if removed
- string ToString() - The string representation of the object.
Properties
- int Count { get; } - Number of specific quarantines
- bool Include { get; set; } - Include users that match rule, or exclude
- string ObjectTypeName { get; } - The name of the type of object.
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples
//Create a new group
string groupName = "Test Group Builder: quarantineVariable ";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ];
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
GroupBuilderQuarantineVariable quarantineVariable = new GroupBuilderQuarantineVariable();
quarantineVariable.Include=true;
quarantineVariable.Add(15542993);
quarantineVariable.Add(15549081);
print(quarantineVariable.Count);//2
print(quarantineVariable[0]);//quarantineRId 15542993
print(quarantineVariable[1]);//quarantineRId 15549081
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(quarantineVariable);
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule);
root.Save();
<br/>
<source lang="javascript">
GroupBuilderRoot root = new GroupBuilderRoot (15560629);
GroupBuilderRuleCollection ruleColection = root.RootRules;
GroupBuilderRule rule = ruleColection[0];
GroupBuilderQuarantineVariable quarantineVariable = rule[0];
print(quarantineVariable.Count);//2
quarantineVariable.Remove(quarantineVariable[0]);
print(quarantineVariable.Count);//1
root.Save();