Exemple #1
0
        public ManagementPolicyDefinition(ManagementPolicyAction actions)
        {
            if (actions == null)
            {
                throw new ArgumentNullException(nameof(actions));
            }

            Actions = actions;
        }
        internal static ManagementPolicyDefinition DeserializeManagementPolicyDefinition(JsonElement element)
        {
            ManagementPolicyAction            actions = default;
            Optional <ManagementPolicyFilter> filters = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("actions"))
                {
                    actions = ManagementPolicyAction.DeserializeManagementPolicyAction(property.Value);
                    continue;
                }
                if (property.NameEquals("filters"))
                {
                    filters = ManagementPolicyFilter.DeserializeManagementPolicyFilter(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyDefinition(actions, filters.Value));
        }
Exemple #3
0
 internal ManagementPolicyDefinition(ManagementPolicyAction actions, ManagementPolicyFilter filters)
 {
     Actions = actions;
     Filters = filters;
 }