Example #1
0
 internal VirtualMachineScaleSetVMInstanceView(int?platformUpdateDomain, int?platformFaultDomain, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IReadOnlyList <DiskInstanceView> disks, IReadOnlyList <VirtualMachineExtensionInstanceView> extensions, VirtualMachineHealthStatus vmHealth, BootDiagnosticsInstanceView bootDiagnostics, IReadOnlyList <InstanceViewStatus> statuses, string placementGroupId)
 {
     PlatformUpdateDomain = platformUpdateDomain;
     PlatformFaultDomain  = platformFaultDomain;
     RdpThumbPrint        = rdpThumbPrint;
     VmAgent = vmAgent;
     MaintenanceRedeployStatus = maintenanceRedeployStatus;
     Disks            = disks;
     Extensions       = extensions;
     VmHealth         = vmHealth;
     BootDiagnostics  = bootDiagnostics;
     Statuses         = statuses;
     PlacementGroupId = placementGroupId;
 }
Example #2
0
 internal VirtualMachineInstanceView(int?platformUpdateDomain, int?platformFaultDomain, string computerName, string osName, string osVersion, HyperVGenerationType?hyperVGeneration, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IReadOnlyList <DiskInstanceView> disks, IReadOnlyList <VirtualMachineExtensionInstanceView> extensions, BootDiagnosticsInstanceView bootDiagnostics, IReadOnlyList <InstanceViewStatus> statuses)
 {
     PlatformUpdateDomain = platformUpdateDomain;
     PlatformFaultDomain  = platformFaultDomain;
     ComputerName         = computerName;
     OsName                    = osName;
     OsVersion                 = osVersion;
     HyperVGeneration          = hyperVGeneration;
     RdpThumbPrint             = rdpThumbPrint;
     VmAgent                   = vmAgent;
     MaintenanceRedeployStatus = maintenanceRedeployStatus;
     Disks           = disks;
     Extensions      = extensions;
     BootDiagnostics = bootDiagnostics;
     Statuses        = statuses;
 }
 internal VirtualMachineInstanceView(int?platformUpdateDomain, int?platformFaultDomain, string computerName, string oSName, string oSVersion, HyperVGenerationType?hyperVGeneration, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IReadOnlyList <DiskInstanceView> disks, IReadOnlyList <VirtualMachineExtensionInstanceView> extensions, VirtualMachineHealthStatus vmHealth, BootDiagnosticsInstanceView bootDiagnostics, string assignedHost, IReadOnlyList <InstanceViewStatus> statuses, VirtualMachinePatchStatus patchStatus)
 {
     PlatformUpdateDomain = platformUpdateDomain;
     PlatformFaultDomain  = platformFaultDomain;
     ComputerName         = computerName;
     OSName                    = oSName;
     OSVersion                 = oSVersion;
     HyperVGeneration          = hyperVGeneration;
     RdpThumbPrint             = rdpThumbPrint;
     VmAgent                   = vmAgent;
     MaintenanceRedeployStatus = maintenanceRedeployStatus;
     Disks           = disks;
     Extensions      = extensions;
     VmHealth        = vmHealth;
     BootDiagnostics = bootDiagnostics;
     AssignedHost    = assignedHost;
     Statuses        = statuses;
     PatchStatus     = patchStatus;
 }
        internal static VirtualMachineScaleSetVMInstanceView DeserializeVirtualMachineScaleSetVMInstanceView(JsonElement element)
        {
            Optional <int>    platformUpdateDomain = default;
            Optional <int>    platformFaultDomain  = default;
            Optional <string> rdpThumbPrint        = default;
            Optional <VirtualMachineAgentInstanceView>   vmAgent = default;
            Optional <MaintenanceRedeployStatus>         maintenanceRedeployStatus = default;
            Optional <IReadOnlyList <DiskInstanceView> > disks = default;
            Optional <IReadOnlyList <VirtualMachineExtensionInstanceView> > extensions = default;
            Optional <VirtualMachineHealthStatus>          vmHealth        = default;
            Optional <BootDiagnosticsInstanceView>         bootDiagnostics = default;
            Optional <IReadOnlyList <InstanceViewStatus> > statuses        = default;
            Optional <string> placementGroupId = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("platformUpdateDomain"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    platformUpdateDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("platformFaultDomain"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    platformFaultDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("rdpThumbPrint"))
                {
                    rdpThumbPrint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("vmAgent"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vmAgent = VirtualMachineAgentInstanceView.DeserializeVirtualMachineAgentInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("maintenanceRedeployStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maintenanceRedeployStatus = MaintenanceRedeployStatus.DeserializeMaintenanceRedeployStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("disks"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DiskInstanceView> array = new List <DiskInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DiskInstanceView.DeserializeDiskInstanceView(item));
                    }
                    disks = array;
                    continue;
                }
                if (property.NameEquals("extensions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <VirtualMachineExtensionInstanceView> array = new List <VirtualMachineExtensionInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualMachineExtensionInstanceView.DeserializeVirtualMachineExtensionInstanceView(item));
                    }
                    extensions = array;
                    continue;
                }
                if (property.NameEquals("vmHealth"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vmHealth = VirtualMachineHealthStatus.DeserializeVirtualMachineHealthStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("bootDiagnostics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    bootDiagnostics = BootDiagnosticsInstanceView.DeserializeBootDiagnosticsInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("statuses"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <InstanceViewStatus> array = new List <InstanceViewStatus>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
                    }
                    statuses = array;
                    continue;
                }
                if (property.NameEquals("placementGroupId"))
                {
                    placementGroupId = property.Value.GetString();
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVMInstanceView(Optional.ToNullable(platformUpdateDomain), Optional.ToNullable(platformFaultDomain), rdpThumbPrint.Value, vmAgent.Value, maintenanceRedeployStatus.Value, Optional.ToList(disks), Optional.ToList(extensions), vmHealth.Value, bootDiagnostics.Value, Optional.ToList(statuses), placementGroupId.Value));
        }
Example #5
0
        internal static VirtualMachineInstanceView DeserializeVirtualMachineInstanceView(JsonElement element)
        {
            int?   platformUpdateDomain = default;
            int?   platformFaultDomain  = default;
            string computerName         = default;
            string osName    = default;
            string osVersion = default;
            HyperVGenerationType?hyperVGeneration = default;
            string rdpThumbPrint = default;
            VirtualMachineAgentInstanceView             vmAgent = default;
            MaintenanceRedeployStatus                   maintenanceRedeployStatus = default;
            IList <DiskInstanceView>                    disks           = default;
            IList <VirtualMachineExtensionInstanceView> extensions      = default;
            BootDiagnosticsInstanceView                 bootDiagnostics = default;
            IList <InstanceViewStatus>                  statuses        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("platformUpdateDomain"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    platformUpdateDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("platformFaultDomain"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    platformFaultDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("computerName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    computerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("osName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    osName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("osVersion"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    osVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("hyperVGeneration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    hyperVGeneration = new HyperVGenerationType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("rdpThumbPrint"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    rdpThumbPrint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("vmAgent"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    vmAgent = VirtualMachineAgentInstanceView.DeserializeVirtualMachineAgentInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("maintenanceRedeployStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    maintenanceRedeployStatus = MaintenanceRedeployStatus.DeserializeMaintenanceRedeployStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("disks"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <DiskInstanceView> array = new List <DiskInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(DiskInstanceView.DeserializeDiskInstanceView(item));
                        }
                    }
                    disks = array;
                    continue;
                }
                if (property.NameEquals("extensions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <VirtualMachineExtensionInstanceView> array = new List <VirtualMachineExtensionInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(VirtualMachineExtensionInstanceView.DeserializeVirtualMachineExtensionInstanceView(item));
                        }
                    }
                    extensions = array;
                    continue;
                }
                if (property.NameEquals("bootDiagnostics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    bootDiagnostics = BootDiagnosticsInstanceView.DeserializeBootDiagnosticsInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("statuses"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <InstanceViewStatus> array = new List <InstanceViewStatus>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
                        }
                    }
                    statuses = array;
                    continue;
                }
            }
            return(new VirtualMachineInstanceView(platformUpdateDomain, platformFaultDomain, computerName, osName, osVersion, hyperVGeneration, rdpThumbPrint, vmAgent, maintenanceRedeployStatus, disks, extensions, bootDiagnostics, statuses));
        }
Example #6
0
        internal static VirtualMachineInstanceView DeserializeVirtualMachineInstanceView(JsonElement element)
        {
            Optional <int>    platformUpdateDomain = default;
            Optional <int>    platformFaultDomain  = default;
            Optional <string> computerName         = default;
            Optional <string> osName    = default;
            Optional <string> osVersion = default;
            Optional <HyperVGenerationType> hyperVGeneration = default;
            Optional <string> rdpThumbPrint = default;
            Optional <VirtualMachineAgentInstanceView>   vmAgent = default;
            Optional <MaintenanceRedeployStatus>         maintenanceRedeployStatus = default;
            Optional <IReadOnlyList <DiskInstanceView> > disks = default;
            Optional <IReadOnlyList <VirtualMachineExtensionInstanceView> > extensions = default;
            Optional <BootDiagnosticsInstanceView>         bootDiagnostics             = default;
            Optional <IReadOnlyList <InstanceViewStatus> > statuses = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("platformUpdateDomain"))
                {
                    platformUpdateDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("platformFaultDomain"))
                {
                    platformFaultDomain = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("computerName"))
                {
                    computerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("osName"))
                {
                    osName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("osVersion"))
                {
                    osVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("hyperVGeneration"))
                {
                    hyperVGeneration = new HyperVGenerationType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("rdpThumbPrint"))
                {
                    rdpThumbPrint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("vmAgent"))
                {
                    vmAgent = VirtualMachineAgentInstanceView.DeserializeVirtualMachineAgentInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("maintenanceRedeployStatus"))
                {
                    maintenanceRedeployStatus = MaintenanceRedeployStatus.DeserializeMaintenanceRedeployStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("disks"))
                {
                    List <DiskInstanceView> array = new List <DiskInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DiskInstanceView.DeserializeDiskInstanceView(item));
                    }
                    disks = array;
                    continue;
                }
                if (property.NameEquals("extensions"))
                {
                    List <VirtualMachineExtensionInstanceView> array = new List <VirtualMachineExtensionInstanceView>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualMachineExtensionInstanceView.DeserializeVirtualMachineExtensionInstanceView(item));
                    }
                    extensions = array;
                    continue;
                }
                if (property.NameEquals("bootDiagnostics"))
                {
                    bootDiagnostics = BootDiagnosticsInstanceView.DeserializeBootDiagnosticsInstanceView(property.Value);
                    continue;
                }
                if (property.NameEquals("statuses"))
                {
                    List <InstanceViewStatus> array = new List <InstanceViewStatus>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
                    }
                    statuses = array;
                    continue;
                }
            }
            return(new VirtualMachineInstanceView(Optional.ToNullable(platformUpdateDomain), Optional.ToNullable(platformFaultDomain), computerName.Value, osName.Value, osVersion.Value, Optional.ToNullable(hyperVGeneration), rdpThumbPrint.Value, vmAgent.Value, maintenanceRedeployStatus.Value, Optional.ToList(disks), Optional.ToList(extensions), bootDiagnostics.Value, Optional.ToList(statuses)));
        }