internal static MediaGraphInstanceProperties DeserializeMediaGraphInstanceProperties(JsonElement element) { Optional <string> description = default; Optional <string> topologyName = default; Optional <IList <MediaGraphParameterDefinition> > parameters = default; Optional <MediaGraphInstanceState> state = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("topologyName")) { topologyName = property.Value.GetString(); continue; } if (property.NameEquals("parameters")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <MediaGraphParameterDefinition> array = new List <MediaGraphParameterDefinition>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(MediaGraphParameterDefinition.DeserializeMediaGraphParameterDefinition(item)); } parameters = array; continue; } if (property.NameEquals("state")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } state = new MediaGraphInstanceState(property.Value.GetString()); continue; } } return(new MediaGraphInstanceProperties(description.Value, topologyName.Value, Optional.ToList(parameters), Optional.ToNullable(state))); }
public static string ToSerialString(this MediaGraphInstanceState value) => value switch {