Ejemplo n.º 1
0
        internal static VirtualMachineScaleSetVmExtensionsSummary DeserializeVirtualMachineScaleSetVmExtensionsSummary(JsonElement element)
        {
            Optional <string> name = default;
            Optional <IReadOnlyList <VirtualMachineStatusCodeCount> > statusesSummary = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("statusesSummary"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <VirtualMachineStatusCodeCount> array = new List <VirtualMachineStatusCodeCount>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualMachineStatusCodeCount.DeserializeVirtualMachineStatusCodeCount(item));
                    }
                    statusesSummary = array;
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVmExtensionsSummary(name.Value, Optional.ToList(statusesSummary)));
        }
Ejemplo n.º 2
0
        internal static VirtualMachineScaleSetInstanceViewStatusesSummary DeserializeVirtualMachineScaleSetInstanceViewStatusesSummary(JsonElement element)
        {
            IReadOnlyList <VirtualMachineStatusCodeCount> statusesSummary = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("statusesSummary"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <VirtualMachineStatusCodeCount> array = new List <VirtualMachineStatusCodeCount>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(VirtualMachineStatusCodeCount.DeserializeVirtualMachineStatusCodeCount(item));
                        }
                    }
                    statusesSummary = array;
                    continue;
                }
            }
            return(new VirtualMachineScaleSetInstanceViewStatusesSummary(statusesSummary));
        }