From eb58106a890d0ee5eb5b0c51d5ec3e59b98e1815 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 28 Feb 2023 20:19:37 +0000 Subject: [PATCH] CodeGen from PR 22829 in Azure/azure-rest-api-specs Merge 940ed5de92429dc8918147317978d888ae804ff6 into 5c9459305484e0456b4a922e3d31a61e2ddd3c99 --- ....ResourceManager.Compute.netstandard2.0.cs | 26 ++++++++- .../Models/EdgeZoneStorageAccountType.cs | 57 +++++++++++++++++++ ...eryTargetExtendedLocation.Serialization.cs | 4 +- .../Models/GalleryTargetExtendedLocation.cs | 4 +- .../src/Generated/Models/HyperVGeneration.cs | 2 +- .../Models/OSImageNotificationProfile.cs | 4 +- ...ineScaleSetVmInstanceView.Serialization.cs | 31 +++++++++- .../VirtualMachineScaleSetVmInstanceView.cs | 18 +++++- .../src/autorest.md | 2 +- 9 files changed, 137 insertions(+), 11 deletions(-) create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/EdgeZoneStorageAccountType.cs diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs index e41eb21db5ef..80fcf81c225f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs @@ -3427,6 +3427,26 @@ public DiskSku() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.DiskStorageAccountType left, Azure.ResourceManager.Compute.Models.DiskStorageAccountType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EdgeZoneStorageAccountType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EdgeZoneStorageAccountType(string value) { throw null; } + public static Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType PremiumLrs { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType StandardLrs { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType StandardSsdLrs { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType StandardZrs { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType left, Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType left, Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType right) { throw null; } + public override string ToString() { throw null; } + } public partial class EncryptionImages { public EncryptionImages() { } @@ -3784,7 +3804,7 @@ public GalleryTargetExtendedLocation() { } public Azure.ResourceManager.Compute.Models.GalleryExtendedLocation ExtendedLocation { get { throw null; } set { } } public int? ExtendedLocationReplicaCount { get { throw null; } set { } } public string Name { get { throw null; } set { } } - public Azure.ResourceManager.Compute.Models.ImageStorageAccountType? StorageAccountType { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.EdgeZoneStorageAccountType? StorageAccountType { get { throw null; } set { } } } public partial class GrantAccessData { @@ -6078,9 +6098,13 @@ public partial class VirtualMachineScaleSetVmInstanceView internal VirtualMachineScaleSetVmInstanceView() { } public Azure.Core.ResourceIdentifier AssignedHost { get { throw null; } } public Azure.ResourceManager.Compute.Models.BootDiagnosticsInstanceView BootDiagnostics { get { throw null; } } + public string ComputerName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Disks { get { throw null; } } public System.Collections.Generic.IReadOnlyList Extensions { get { throw null; } } + public Azure.ResourceManager.Compute.Models.HyperVGeneration? HyperVGeneration { get { throw null; } } public Azure.ResourceManager.Compute.Models.MaintenanceRedeployStatus MaintenanceRedeployStatus { get { throw null; } } + public string OSName { get { throw null; } } + public string OSVersion { get { throw null; } } public string PlacementGroupId { get { throw null; } } public int? PlatformFaultDomain { get { throw null; } } public int? PlatformUpdateDomain { get { throw null; } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/EdgeZoneStorageAccountType.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/EdgeZoneStorageAccountType.cs new file mode 100644 index 000000000000..d14b736bc77c --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/EdgeZoneStorageAccountType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the storage account type to be used to store the image. This property is not updatable. + public readonly partial struct EdgeZoneStorageAccountType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EdgeZoneStorageAccountType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLrsValue = "Standard_LRS"; + private const string StandardZrsValue = "Standard_ZRS"; + private const string StandardSsdLrsValue = "StandardSSD_LRS"; + private const string PremiumLrsValue = "Premium_LRS"; + + /// Standard_LRS. + public static EdgeZoneStorageAccountType StandardLrs { get; } = new EdgeZoneStorageAccountType(StandardLrsValue); + /// Standard_ZRS. + public static EdgeZoneStorageAccountType StandardZrs { get; } = new EdgeZoneStorageAccountType(StandardZrsValue); + /// StandardSSD_LRS. + public static EdgeZoneStorageAccountType StandardSsdLrs { get; } = new EdgeZoneStorageAccountType(StandardSsdLrsValue); + /// Premium_LRS. + public static EdgeZoneStorageAccountType PremiumLrs { get; } = new EdgeZoneStorageAccountType(PremiumLrsValue); + /// Determines if two values are the same. + public static bool operator ==(EdgeZoneStorageAccountType left, EdgeZoneStorageAccountType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EdgeZoneStorageAccountType left, EdgeZoneStorageAccountType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EdgeZoneStorageAccountType(string value) => new EdgeZoneStorageAccountType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EdgeZoneStorageAccountType other && Equals(other); + /// + public bool Equals(EdgeZoneStorageAccountType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.Serialization.cs index 526e6b017d1e..b7d4d6beeecf 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.Serialization.cs @@ -48,7 +48,7 @@ internal static GalleryTargetExtendedLocation DeserializeGalleryTargetExtendedLo Optional name = default; Optional extendedLocation = default; Optional extendedLocationReplicaCount = default; - Optional storageAccountType = default; + Optional storageAccountType = default; Optional encryption = default; foreach (var property in element.EnumerateObject()) { @@ -84,7 +84,7 @@ internal static GalleryTargetExtendedLocation DeserializeGalleryTargetExtendedLo property.ThrowNonNullablePropertyIsNull(); continue; } - storageAccountType = new ImageStorageAccountType(property.Value.GetString()); + storageAccountType = new EdgeZoneStorageAccountType(property.Value.GetString()); continue; } if (property.NameEquals("encryption"u8)) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.cs index 27d8275fc421..d8b19b11ecfe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GalleryTargetExtendedLocation.cs @@ -21,7 +21,7 @@ public GalleryTargetExtendedLocation() /// The number of replicas of the Image Version to be created per extended location. This property is updatable. /// Specifies the storage account type to be used to store the image. This property is not updatable. /// Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - internal GalleryTargetExtendedLocation(string name, GalleryExtendedLocation extendedLocation, int? extendedLocationReplicaCount, ImageStorageAccountType? storageAccountType, EncryptionImages encryption) + internal GalleryTargetExtendedLocation(string name, GalleryExtendedLocation extendedLocation, int? extendedLocationReplicaCount, EdgeZoneStorageAccountType? storageAccountType, EncryptionImages encryption) { Name = name; ExtendedLocation = extendedLocation; @@ -37,7 +37,7 @@ internal GalleryTargetExtendedLocation(string name, GalleryExtendedLocation exte /// The number of replicas of the Image Version to be created per extended location. This property is updatable. public int? ExtendedLocationReplicaCount { get; set; } /// Specifies the storage account type to be used to store the image. This property is not updatable. - public ImageStorageAccountType? StorageAccountType { get; set; } + public EdgeZoneStorageAccountType? StorageAccountType { get; set; } /// Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. public EncryptionImages Encryption { get; set; } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/HyperVGeneration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/HyperVGeneration.cs index 7f7391c18988..96aea5072e02 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/HyperVGeneration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/HyperVGeneration.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies the HyperVGeneration Type associated with a resource. + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks only. public readonly partial struct HyperVGeneration : IEquatable { private readonly string _value; diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/OSImageNotificationProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/OSImageNotificationProfile.cs index 264b640ab101..9479d167f19e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/OSImageNotificationProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/OSImageNotificationProfile.cs @@ -16,7 +16,7 @@ public OSImageNotificationProfile() } /// Initializes a new instance of OSImageNotificationProfile. - /// Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, with the value set to 15 minutes (PT15M). + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). /// Specifies whether the OS Image Scheduled event is enabled or disabled. internal OSImageNotificationProfile(string notBeforeTimeout, bool? enable) { @@ -24,7 +24,7 @@ internal OSImageNotificationProfile(string notBeforeTimeout, bool? enable) Enable = enable; } - /// Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, with the value set to 15 minutes (PT15M). + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). public string NotBeforeTimeout { get; set; } /// Specifies whether the OS Image Scheduled event is enabled or disabled. public bool? Enable { get; set; } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.Serialization.cs index 5f8ea29716e5..1c5db6b54b9b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.Serialization.cs @@ -27,6 +27,10 @@ internal static VirtualMachineScaleSetVmInstanceView DeserializeVirtualMachineSc Optional> statuses = default; Optional assignedHost = default; Optional placementGroupId = default; + Optional computerName = default; + Optional osName = default; + Optional osVersion = default; + Optional hyperVGeneration = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("platformUpdateDomain"u8)) @@ -154,8 +158,33 @@ internal static VirtualMachineScaleSetVmInstanceView DeserializeVirtualMachineSc placementGroupId = property.Value.GetString(); continue; } + if (property.NameEquals("computerName"u8)) + { + computerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("osVersion"u8)) + { + osVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hyperVGeneration = new HyperVGeneration(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), assignedHost.Value, placementGroupId.Value); + 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), assignedHost.Value, placementGroupId.Value, computerName.Value, osName.Value, osVersion.Value, Optional.ToNullable(hyperVGeneration)); } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.cs index 293e5c654f9f..1ae79829afc5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmInstanceView.cs @@ -34,7 +34,11 @@ internal VirtualMachineScaleSetVmInstanceView() /// The resource status information. /// Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. /// The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - internal VirtualMachineScaleSetVmInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IReadOnlyList disks, IReadOnlyList extensions, VirtualMachineHealthStatus vmHealth, BootDiagnosticsInstanceView bootDiagnostics, IReadOnlyList statuses, ResourceIdentifier assignedHost, string placementGroupId) + /// Specifies the host OS name of the virtual machine. <br><br> This name cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + /// The Operating System running on the hybrid machine. + /// The version of Operating System running on the hybrid machine. + /// The hypervisor generation of the Virtual Machine [V1, V2]. + internal VirtualMachineScaleSetVmInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IReadOnlyList disks, IReadOnlyList extensions, VirtualMachineHealthStatus vmHealth, BootDiagnosticsInstanceView bootDiagnostics, IReadOnlyList statuses, ResourceIdentifier assignedHost, string placementGroupId, string computerName, string osName, string osVersion, HyperVGeneration? hyperVGeneration) { PlatformUpdateDomain = platformUpdateDomain; PlatformFaultDomain = platformFaultDomain; @@ -48,6 +52,10 @@ internal VirtualMachineScaleSetVmInstanceView(int? platformUpdateDomain, int? pl Statuses = statuses; AssignedHost = assignedHost; PlacementGroupId = placementGroupId; + ComputerName = computerName; + OSName = osName; + OSVersion = osVersion; + HyperVGeneration = hyperVGeneration; } /// The Update Domain count. @@ -80,5 +88,13 @@ public InstanceViewStatus VmHealthStatus public ResourceIdentifier AssignedHost { get; } /// The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. public string PlacementGroupId { get; } + /// Specifies the host OS name of the virtual machine. <br><br> This name cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + public string ComputerName { get; } + /// The Operating System running on the hybrid machine. + public string OSName { get; } + /// The version of Operating System running on the hybrid machine. + public string OSVersion { get; } + /// The hypervisor generation of the Virtual Machine [V1, V2]. + public HyperVGeneration? HyperVGeneration { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md index aac5143706b5..48ac5f724cbf 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md +++ b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md @@ -11,7 +11,7 @@ azure-arm: true generate-model-factory: false library-name: Compute namespace: Azure.ResourceManager.Compute -require: https://github.com/Azure/azure-rest-api-specs/blob/1ef2c08c58b21094edc5b8d2cb12d1bbc6d2d068/specification/compute/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/compute/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true