Ejemplo n.º 1
0
        internal static HardwareProfile DeserializeHardwareProfile(JsonElement element)
        {
            Optional <VirtualMachineSizeTypes> vmSize           = default;
            Optional <VMSizeProperties>        vmSizeProperties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("vmSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vmSize = new VirtualMachineSizeTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("vmSizeProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vmSizeProperties = VMSizeProperties.DeserializeVMSizeProperties(property.Value);
                    continue;
                }
            }
            return(new HardwareProfile(Optional.ToNullable(vmSize), vmSizeProperties.Value));
        }
Ejemplo n.º 2
0
        internal static HardwareProfile DeserializeHardwareProfile(JsonElement element)
        {
            Optional <VirtualMachineSizeTypes> vmSize = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("vmSize"))
                {
                    vmSize = new VirtualMachineSizeTypes(property.Value.GetString());
                    continue;
                }
            }
            return(new HardwareProfile(Optional.ToNullable(vmSize)));
        }
Ejemplo n.º 3
0
        internal static HardwareProfile DeserializeHardwareProfile(JsonElement element)
        {
            VirtualMachineSizeTypes?vmSize = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("vmSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    vmSize = new VirtualMachineSizeTypes(property.Value.GetString());
                    continue;
                }
            }
            return(new HardwareProfile(vmSize));
        }