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"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    filters = ManagementPolicyFilter.DeserializeManagementPolicyFilter(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyDefinition(actions, filters.Value));
        }
コード例 #2
0
 internal ManagementPolicyDefinition(ManagementPolicyAction actions, ManagementPolicyFilter filters)
 {
     Actions = actions;
     Filters = filters;
 }