internal static ManagementPolicyAction DeserializeManagementPolicyAction(JsonElement element)
        {
            ManagementPolicyBaseBlob baseBlob = default;
            ManagementPolicySnapShot snapshot = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("baseBlob"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    baseBlob = ManagementPolicyBaseBlob.DeserializeManagementPolicyBaseBlob(property.Value);
                    continue;
                }
                if (property.NameEquals("snapshot"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    snapshot = ManagementPolicySnapShot.DeserializeManagementPolicySnapShot(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyAction(baseBlob, snapshot));
        }
Ejemplo n.º 2
0
        internal static ManagementPolicyAction DeserializeManagementPolicyAction(JsonElement element)
        {
            Optional <ManagementPolicyBaseBlob> baseBlob = default;
            Optional <ManagementPolicySnapShot> snapshot = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("baseBlob"))
                {
                    baseBlob = ManagementPolicyBaseBlob.DeserializeManagementPolicyBaseBlob(property.Value);
                    continue;
                }
                if (property.NameEquals("snapshot"))
                {
                    snapshot = ManagementPolicySnapShot.DeserializeManagementPolicySnapShot(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyAction(baseBlob.Value, snapshot.Value));
        }