Esempio n. 1
0
        internal static MediaGraphTopologyCollection DeserializeMediaGraphTopologyCollection(JsonElement element)
        {
            Optional <IList <MediaGraphTopology> > value = default;
            Optional <string> continuationToken          = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MediaGraphTopology> array = new List <MediaGraphTopology>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MediaGraphTopology.DeserializeMediaGraphTopology(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("@continuationToken"))
                {
                    continuationToken = property.Value.GetString();
                    continue;
                }
            }
            return(new MediaGraphTopologyCollection(Optional.ToList(value), continuationToken.Value));
        }
        internal static MediaGraphTopologySetRequest DeserializeMediaGraphTopologySetRequest(JsonElement element)
        {
            MediaGraphTopology graph      = default;
            string             methodName = default;
            Optional <string>  apiVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("graph"))
                {
                    graph = MediaGraphTopology.DeserializeMediaGraphTopology(property.Value);
                    continue;
                }
                if (property.NameEquals("methodName"))
                {
                    methodName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("@apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new MediaGraphTopologySetRequest(methodName, apiVersion.Value, graph));
        }